Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix X2Effect_Brutal by using GetCurrentStat() instead of GetBaseStat() #1392

Merged
merged 2 commits into from
Sep 13, 2024

Conversation

boundir
Copy link
Contributor

@boundir boundir commented Sep 12, 2024

Fixes #1389

Fixes Brutal effect by using GetCurrentStat() instead of GetBaseStat().

@boundir boundir mentioned this pull request Sep 12, 2024
@@ -11,7 +11,7 @@ simulated protected function OnEffectAdded(const out EffectAppliedData ApplyEffe
TargetUnit = XComGameState_Unit(kNewTargetState);
if (TargetUnit != none)
{
CurrentWill = TargetUnit.GetBaseStat(eStat_Will);
CurrentWill = TargetUnit.GetCurrentStat(eStat_Will); // issue 1389
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All Highlander submissions must follow the same comment convention.

For single line change, you would use // Single line for Issue #1389, and for anything more than one line, you would use // Start Issue #1389 and // End Issue #1389. Then there are Highlander inline docs, which get compiled automatically into this webpage: https://x2communitycore.github.io/X2WOTCCommunityHighlander/

They use a single /// HL-Docs: entry, and there are two types of those, one is used to document features, so they can be easier used by mod authors, and other uses to document bugfixes, and these are meant for mod users, and all get compiled into a single page: https://x2communitycore.github.io/X2WOTCCommunityHighlander/Bugfixes/

In case of single line bugfixes, it is acceptable to use a HL-Docs entry instead of "single line for issue".

Only one HL-Docs entry per issue is needed normally.

In this case comments would look like:

/// HL-Docs: ref:Bugfixes; issue:1389
/// Make `X2Effect_Brutal` use unit's current Will instead of base Will so it can properly reduce it.
// Single line for Issue #1389 - use GetCurrentStat() instead of GetBaseStat().
CurrentWill = TargetUnit.GetCurrentStat(eStat_Will);

and

// Single line for Issue #1389 - use GetCurrentStat() instead of GetBaseStat().
WillChange = NewUnit.GetCurrentStat(eStat_Will) - OldUnit.GetCurrentStat(eStat_Will);

@Iridar Iridar changed the title Fixes issue #1389 Fix X2Effect_Brutal by using GetCurrentStat() instead of GetBaseStat() Sep 13, 2024
@Iridar Iridar added this to the 1.29.0 milestone Sep 13, 2024
@Iridar Iridar added bug-basegame waiting-on-author A pull request is waiting on changes from the author labels Sep 13, 2024
@Iridar
Copy link
Contributor

Iridar commented Sep 13, 2024

Perfect, though a bit annoyingly I have to ask you to squish the last two commits together, so there's still one commit with adding new files, and one commit where the issue gets actually resolved. This can be done via $git rebase -i HEAD~2 git command.

@Iridar Iridar added ready-for-merge the pull request was reviewed and is ready to be merged. and removed waiting-on-author A pull request is waiting on changes from the author labels Sep 13, 2024
@Iridar Iridar merged commit ada510d into X2CommunityCore:master Sep 13, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-basegame ready-for-merge the pull request was reviewed and is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ChosenBrutal restores will
2 participants