Jump to content

[LW] Hit and Run bug


azxeus

Recommended Posts

ooooh i should have been checking if i have moved not if i haven't
(i still think the move check is a good idea)

I changed the == to < and now it works as expected.

I guess i should test to make sure all the other conditions in this file work correctly now


Thanks for all the help!

(EDIT: nope all of them go to increment, that's what 06D70D does, it's a pointer to ++ m_kUnit.m_iFireActionsPerformed; at the bottom and they all have that including LeU)


/*(0x035C/0x0264)*/ 07 [@label_0x0415] 82 84 19 19 01 <@m_kUnit> [@] <XGUnit.GetCharacter.ReturnValue> 00 ( 1B <GetCharacter> 16 ) [@] <XGCharacter.HasUpgrade.ReturnValue> 00 ( 1B <HasUpgrade> 2C 7E 16 ) 18 [@] ( 9A 19 01 <@m_kUnit> [@] <XGUnitNativeBase.GetCharType.ReturnValue> 00 ( 1B <GetCharType> 16 ) 2C 15 16 16 ) 18 [@] ( 9A 1B <GetType> 16 2C 07 16 16 ) 
/*(0x03D1/0x02C5)*/ 	19 01 <@m_kUnit> [@] <XGUnitNativeBase.m_bFreeFireActionTaken> 00 ( 2D 01 <XGUnitNativeBase.m_bFreeFireActionTaken> ) 
/*(0x03F0/0x02D8)*/ 	0B 
/*(0x03F1/0x02D9)*/ 	0B 
/*(0x03F2/0x02DA)*/ 	A5 19 01 <@m_kUnit> [@] <XGUnitNativeBase.m_iMovesActionsPerformed> 00 ( 01 <XGUnitNativeBase.m_iMovesActionsPerformed> ) 16 
/*(0x0412/0x02EE)*/ 	06 [@label_0x0DD7] 
/*(0x0415/0x02F1)*/ [#label_0x0415]
Edited by azxeus
Link to comment
Share on other sites

Nice, glad you got it working!

 

Like I mentioned earlier, the jumps at the end of if blocks are there to jump over the elses, otherwise it'd execute the "then" part and then fall right into the "else", which is clearly not good. 0xDD7 is the offset following that huge nested else, it's the address of "if (m_kUnit.IsAffectedByAbility(92))" that immediately follows the huge block. You can see this in UE explorer if you right-click on the "ApplyCost" function in the class tree and select "view tokens". Scroll down and you see this:

(0xDD7) JumpIfNot(36) -> Context(33) -> InstanceVariable(9) -> VirtualFunction(12) -> IntConstByte(2) -> EndFunctionParms(1)
    if(m_kUnit.IsAffectedByAbility(92))

The increment is at 0xDB7, just before it. If it incremented fire actions for LeU it'd be a total cost of 1 move + 1 fire, which would be turn ending on the first shot, since it doesn't set the free shot flag. Since there is that dead code there that references the free shot flag but without modifying it it's possible that's how it worked at one point.

Link to comment
Share on other sites

Yep, xcom modding often involves a lot of facedesk :smile: Now that you have the patch working you might want to share it here on nexusmods and leave a note in /r/xcom or other places in case anyone else wants to use it too!

Edited by tracktwo
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...