Jump to content

[LW] Hit and Run bug


azxeus

Recommended Posts

yeah I think I'm getting the idea so I go if(!=freeshottaken && have(LeU) && actionsleft>1)

(EDIT: no.. wait i don't think that'll make any difference.. that would make things worse.. i think more about this later.. sooo tiired)

Edited by azxeus
Link to comment
Share on other sites

i don't think that'll work.. for starters it looks like to me LeU is the only one of these perks that don't cost the free shot they all have "m_kUnit.m_bFreeFireActionTaken = true;" whereas LeU just has "m_kUnit.m_bFreeFireActionTaken" i believe this is by design. pretty sure this is the reason i can use LeU first and still take a H&R shot after.

also if you mean ++ m_kUnit.m_iFireActionsPerformed; it seems that this is supposed to appear after the action costs otherwise why would it be at the end of the crazy if/else tree?

and why would i be testing if i don't have LeU? i believe what my problem is the game skips it because the H&R code is ending early.. it's kinda like the same problem as before but only half of it

(EDIT: OH! i didn't didn't see that there.. you're right i'll give that a try)

Edited by azxeus
Link to comment
Share on other sites

Let me know how it goes. LeU doesn't look like it considers the shots to be shots at all, just "moves". That's why it doesn't increment fireactions nor set the free shot taken flag. The no-op line in LeU referencing the free shot flag looks as though it used to set the flag but this was disabled.
Link to comment
Share on other sites

I don't get it. It feels like i've done everything correct but i just can't seem to make it show up correctly..

this is what i have so far

before

 

 

/*(0x01D3/0x014B)*/ 07 [@label_0x0218] 19 01 <@m_kUnit> [@] <XGUnitNativeBase.m_bFreeFireActionTaken> 00 ( 2D 01 <XGUnitNativeBase.m_bFreeFireActionTaken> ) 
/*(0x01F5/0x0161)*/ 	A5 19 01 <@m_kUnit> [@] <XGUnitNativeBase.m_iFireActionsPerformed> 00 ( 01 <XGUnitNativeBase.m_iFireActionsPerformed> ) 16 
/*(0x0215/0x0175)*/ 	06 [@label_0x0DD7] 
/*(0x0218/0x0178)*/ [#label_0x0218]
 

becomes

if(m_kUnit.m_bFreeFireActionTaken)
{
      ++ m_kUnit.m_iFireActionsPerformed;
}
// End:0xDD7 

 



 

and i changed it to

/*(0x01D3/0x014B)*/ 07 [@label_0x0218] 19 01 <@m_kUnit> [@] <XGUnitNativeBase.m_bFreeFireActionTaken> 00 ( 2D 01 <XGUnitNativeBase.m_bFreeFireActionTaken> )
			07 [@label_0x01E9] 84 9A 19 01 <@m_kUnit> [@] <XGUnitNativeBase.m_iMovesActionsPerformed> 00 ( 01 <XGUnitNativeBase.m_iMovesActionsPerformed> ) 25 16 18 [@] ( 81 19 19 01 <@m_kUnit> [@] <XGUnit.GetCharacter.ReturnValue> 00 ( 1B <GetCharacter> 16 ) [@] <XGCharacter.HasUpgrade.ReturnValue> 00 ( 1B <HasUpgrade> 2C 7E 16 ) 16 )
/*(0x01F5/0x0161)*/ 		A5 19 01 <@m_kUnit> [@] <XGUnitNativeBase.m_iFireActionsPerformed> 00 ( 01 <XGUnitNativeBase.m_iFireActionsPerformed> ) 16 
			[#label_0x01E9]
/*(0x0215/0x0175)*/ 	06 [@label_0x0DD7] 
/*(0x0218/0x0178)*/ [#label_0x0218]

became


            // End:0x279
            if(m_kUnit.m_bFreeFireActionTaken)
            {
                // End:0x276
                if((m_kUnit.m_iMovesActionsPerformed == 0) || !m_kUnit.GetCharacter().HasUpgrade(126))
                {
                }
            }
            // End:0xE38
            else

As you can see what's supposed to be between inside the if branch isn't there.. even though it's in the patch code.




(EDIT: lol.. here's a bit of an update I swapped the ifs around and one of them disappeared
wth is going on!? Dx )

 

/*(0x01D3/0x014B)*/ 07 [@label_0x0218] 84 9A 19 01 <@m_kUnit> [@] <XGUnitNativeBase.m_iMovesActionsPerformed> 00 ( 01 <XGUnitNativeBase.m_iMovesActionsPerformed> ) 25 16 18 [@] ( 81 19 19 01 <@m_kUnit> [@] <XGUnit.GetCharacter.ReturnValue> 00 ( 1B <GetCharacter> 16 ) [@] <XGCharacter.HasUpgrade.ReturnValue> 00 ( 1B <HasUpgrade> 2C 7E 16 ) 16 ) 
			07 [@label_0x01E9] 19 01 <@m_kUnit> [@] <XGUnitNativeBase.m_bFreeFireActionTaken> 00 ( 2D 01 <XGUnitNativeBase.m_bFreeFireActionTaken> ) 
/*(0x01F5/0x0161)*/ 		A5 19 01 <@m_kUnit> [@] <XGUnitNativeBase.m_iFireActionsPerformed> 00 ( 01 <XGUnitNativeBase.m_iFireActionsPerformed> ) 16 
			[#label_0x01E9]
/*(0x0215/0x0175)*/ 	06 [@label_0x0DD7] 
/*(0x0218/0x0178)*/ [#label_0x0218]

to

            if((m_kUnit.m_iMovesActionsPerformed == 0) || !m_kUnit.GetCharacter().HasUpgrade(126))
            {
                {
                    ++ m_kUnit.m_iFireActionsPerformed;
                }
            }
            // End:0xE38
            else 

 




(EDIT2: nevermind i fixed it by adding a few random 0B lol...)

Edited by azxeus
Link to comment
Share on other sites

Looks like you're missing a function param terminator (16). You only have one at the end of your long || expression before the final close paren, and you need two: one to terminate the ! "function" and another to terminate the || itself. When function terminators are missing the decompiler can get very confused and print bizarre things.

 

That said, I don't think this nested if solution will work: you need to enter the else clause corresponding to the original if (m_kUnit.m_bFreeFireActionTaken), and you won't do this with the nested ifs you have. That's why I suggested the one-level if (m_kUnit.m_bFreeFireActionTaken && !m_kUnit.GetCharacter().HasUpgrade(126)) solution instead. You shouldn't need to test if a move has been taken or not, it won't actually matter if this additional shot counts as a "fire" (if you tested for this) or as a "move" (if you just let it fall down to the LeU code below) because either way you'll be out of actions after it happens. At least that's my impression of how the remaining actions are calculated, I could be wrong on how that works.

Link to comment
Share on other sites

well i'm testing for moves because of the case that I have LeU AND other shot perks because LeU would cause that to always go down which it shouldn't be..

i tried it on one level but it was being weird in different ways so i tried it this way
I didn't know i needed another (16) for my ! it might be the cause to all my problems, i'll try it now.

also what you said about LeU not incrementing shots isn't true, it always get's to a shot increment at the end of the big if/else tree

Link to comment
Share on other sites

okay you were right.. so now i've got

/*(0x01D3/0x014B)*/ 07 [@label_0x0218] 82 84 9A 19 01 <@m_kUnit> [@] <XGUnitNativeBase.m_iMovesActionsPerformed> 00 ( 01 <XGUnitNativeBase.m_iMovesActionsPerformed> ) 25 16 18 [@] ( 81 19 19 01 <@m_kUnit> [@] <XGUnit.GetCharacter.ReturnValue> 00 ( 1B <GetCharacter> 16 ) [@] <XGCharacter.HasUpgrade.ReturnValue> 00 ( 1B <HasUpgrade> 2C 7E 16 ) 16 16 ) 18 [@] ( 19 01 <@m_kUnit> [@] <XGUnitNativeBase.m_bFreeFireActionTaken> 00 ( 2D 01 <XGUnitNativeBase.m_bFreeFireActionTaken> ) 16 )
/*(0x01F5/0x0161)*/ 	A5 19 01 <@m_kUnit> [@] <XGUnitNativeBase.m_iFireActionsPerformed> 00 ( 01 <XGUnitNativeBase.m_iFireActionsPerformed> ) 16 
/*(0x0215/0x0175)*/ 	06 [@label_0x0DD7] 
/*(0x0218/0x0178)*/ [#label_0x0218]

to

        // End:0x26C
        if(((m_kUnit.m_iMovesActionsPerformed == 0) || !m_kUnit.GetCharacter().HasUpgrade(126)) && m_kUnit.m_bFreeFireActionTaken)
        {
            ++ m_kUnit.m_iFireActionsPerformed;
        }
        // End:0xE2B
        else
Edited by azxeus
Link to comment
Share on other sites

Again, you don't want the move check in there.

 

1. Shoot once, H&R fires: sets fire actions to 1 and sets the free shot flag.

 

2. Shoot 2nd time, it enters your if because move is 0 and the flag is set, increments fire actions again (now 2)

 

So now you have 2 fires and one free one == turn end.

 

Take that out and it should be (1) is the same, and 2 sets a move action. Now you have 1 fire, 1 free shot, 1 move, for 1 remaining action.

 

Edit: And from my reading LeU doesn't increment the FireActionsTaken variable, that's in an else that is only entered for non-LeU, but it's hard to read due to the crazy nesting of logic there.

Edited by tracktwo
Link to comment
Share on other sites

  • Recently Browsing   0 members

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