-
Notifications
You must be signed in to change notification settings - Fork 69
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
XCGS_Unit:GetStatModifiers reports bogus modifiers for multipliers #313
Comments
I tested this with Simple Red Fog and it is still giving a positive bonus modifier. |
Are you sure that this is working as intended? I tested it last month with the Simple Red Fog mod and the Beta Highlander, and it was still giving the positive offensive modifiers for values 0-1. |
Try the v1.19 non-beta on the workshop, not sure if this fix was in the beta release on the workshop? |
I double checked the classes XComGameState_unit and X2AbilityToHitCalc_StandardAim for the CHE that I was using at the time of testing. These changes are in the code. I will try it again with the debugger and see what is going on. |
This is using multiplicate red fog set at .87 with the cannon. Note that when I did a melee attack preview it stepped into the function GetStatModifiersFixed with the debugger and everything calculated correctly. When I did the preview and shot with the cannon or assault rifle it did not step into that function and still displayed the positive multiplier of 48. [1695.12] XCom_HitRolls: ===InternalRollForAbilityHit=== [1695.13] XCom_HitRolls: Starting values... |
Here is the same settings for a melee attack. [2061.73] XCom_HitRolls: ===InternalRollForAbilityHit=== [2061.74] XCom_HitRolls: Starting values... |
So the problem seems to be that for standardshot it is using the |
What other mods are you using? |
Ahh. I think I get it now. XModBase_core_2_0_1 is still using GetStatModifiers, and simple red fog uses that. It's also worth noting that RPG is also using XModBase_core for it's ability modifiers. Glad we worked this out. |
Yeah, XModBase has several "hidden" overrides... |
X2WOTCCommunityHighlander/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_Unit.uc
Line 6514 in 8954b83
Instead of returning the correct contribution
(mult - 1) * current_value
, it seems to returnthe value after multiplicationmult * current_value
, at least forMODOP_Multiplication
(and probablyMODOP_PostMultiplication
too).mult * base_stat
for bothMODOP_Multiplication
andMODOP_PostMultiplication
as @MrNiceUK has pointed out to me.The only user of this is
X2AbilityToHitCalc_StandardAim
, which computes a bogus to-hit chance:X2WOTCCommunityHighlander/X2WOTCCommunityHighlander/Src/XComGame/Classes/X2AbilityToHitCalc_StandardAim.uc
Lines 364 to 369 in 8954b83
and a bogus to-crit chance:
X2WOTCCommunityHighlander/X2WOTCCommunityHighlander/Src/XComGame/Classes/X2AbilityToHitCalc_StandardAim.uc
Lines 523 to 528 in 8954b83
where it gives you a positive bonus for multipliers between 0 and 1.
We should fix (or work around) the problem.
The text was updated successfully, but these errors were encountered: