# HG changeset patch # User nemo # Date 1286830560 14400 # Node ID 0f6e3219c10847029232dbf443372c65c4c69497 # Parent 5f4ef3db0a65716dcc5a31488bd2cfc6b1cb64cb set CurAmmoType to a temp var so I don't have to worry about it switching inside the routine so that I can actually put OnUsedAmmo where it belongs. diff -r 5f4ef3db0a65 -r 0f6e3219c108 hedgewars/HHHandlers.inc --- a/hedgewars/HHHandlers.inc Mon Oct 11 16:28:54 2010 -0400 +++ b/hedgewars/HHHandlers.inc Mon Oct 11 16:56:00 2010 -0400 @@ -305,36 +305,35 @@ procedure AfterAttack; var s: shortstring; + a: TAmmoType; begin with CurrentHedgehog^.Gear^, CurrentHedgehog^ do begin + a:= CurAmmoType; State:= State and not gstAttacking; - if (Ammoz[CurAmmoType].Ammo.Propz and ammoprop_Effect) = 0 then + if (Ammoz[a].Ammo.Propz and ammoprop_Effect) = 0 then begin Inc(MultiShootAttacks); - if (Ammoz[CurAmmoType].Ammo.NumPerTurn >= MultiShootAttacks) then + if (Ammoz[a].Ammo.NumPerTurn >= MultiShootAttacks) then begin - s:= inttostr(Ammoz[CurAmmoType].Ammo.NumPerTurn - MultiShootAttacks + 1); + s:= inttostr(Ammoz[a].Ammo.NumPerTurn - MultiShootAttacks + 1); AddCaption(format(trmsg[sidRemaining], s), cWhiteColor, capgrpAmmostate); end; - if (Ammoz[CurAmmoType].Ammo.NumPerTurn >= MultiShootAttacks) or + if (Ammoz[a].Ammo.NumPerTurn >= MultiShootAttacks) or ((GameFlags and gfMultiWeapon) <> 0) then begin isInMultiShoot:= true end else begin - if ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoRoundEndHint) = 0) and ((GameFlags and gfInfAttack) = 0) then - begin - TurnTimeLeft:= Ammoz[CurAmmoType].TimeAfterTurn; - State:= State or gstAttacked - end; - if (Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoRoundEndHint) <> 0 then ApplyAmmoChanges(CurrentHedgehog^); - if (GameFlags and gfInfAttack) <> 0 then State:= State or gstAttacked; - OnUsedAmmo(CurrentHedgehog^) + OnUsedAmmo(CurrentHedgehog^); + if ((Ammoz[a].Ammo.Propz and ammoprop_NoRoundEndHint) = 0) and ((GameFlags and gfInfAttack) = 0) then + TurnTimeLeft:= Ammoz[a].TimeAfterTurn; + if ((Ammoz[a].Ammo.Propz and ammoprop_NoRoundEndHint) = 0) then State:= State or gstAttacked; + if (Ammoz[a].Ammo.Propz and ammoprop_NoRoundEndHint) <> 0 then ApplyAmmoChanges(CurrentHedgehog^) end; end else