XenesisXenon / AW2-InfiniteCOs

A modding project for Advance Wars 2 to allow expansion
http://forums.warsworldnews.com/viewtopic.php?f=11&t=13526
12 stars 6 forks source link

AWDS power charging bug #35

Closed crtusr closed 3 years ago

crtusr commented 3 years ago

When a unit attacks, it loads its own charge modifier instead of the target unit. I.e. I kill an infantry with a rocket and i get 35 (half the rocket's charge value) points of star power instead of 10 the defender gets the correct value of 20

I think the issue is in AW2-InfiniteCOs/Code/PowerChargingModifier/corepowercharge.asm changing line 548 to "ldr r0,[@DefenderRegister]" seemed to fix it.

                        ;This is Damage Inflicted
                    ;Gather Opposing Player's Unit Charge Rate
548              ldr    r0,[@**DefenderRegister**]
                    ldrb    r0,[r0]
                    bl  Gather_DSUnitChargeRate

                    str r0,[sp,0x8] ;Unit Charge Rate in sp+0x8