hedgewars/HHHandlers.inc
changeset 2223 e009fee03c96
parent 2221 ef52dae4130b
child 2238 1a0d26408324
equal deleted inserted replaced
2222:2e98698b76aa 2223:e009fee03c96
   104 begin
   104 begin
   105 with Gear^,
   105 with Gear^,
   106      PHedgehog(Gear^.Hedgehog)^ do
   106      PHedgehog(Gear^.Hedgehog)^ do
   107      begin
   107      begin
   108      if ((State and gstHHDriven) <> 0)and
   108      if ((State and gstHHDriven) <> 0)and
   109         ((State and (gstAttacked or gstHHChooseTarget)) = 0)and
   109         ((State and (gstAttacked or gstHHChooseTarget)) = 0) and
   110         (((State and gstMoving) = 0) or ((Ammo^[CurSlot, CurAmmo].Propz and ammoprop_AttackInMove) <> 0))and
   110         (((State and gstMoving) = 0) or 
       
   111             // Allow attacks while moving on ammo with AltAttack
       
   112             ((CurAmmoGear <> nil) and ((CurAmmoGear^.Ammo^.Propz and ammoprop_AltAttack) <> 0)) or 
       
   113             ((Ammo^[CurSlot, CurAmmo].Propz and ammoprop_AltAttack) <> 0)) and
   111         ((TargetPoint.X <> NoPointX) or ((Ammo^[CurSlot, CurAmmo].Propz and ammoprop_NeedTarget) = 0)) then
   114         ((TargetPoint.X <> NoPointX) or ((Ammo^[CurSlot, CurAmmo].Propz and ammoprop_NeedTarget) = 0)) then
   112         begin
   115         begin
   113         State:= State or gstAttacking;
   116         State:= State or gstAttacking;
   114         if Power = cMaxPower then Message:= Message and not gm_Attack
   117         if Power = cMaxPower then Message:= Message and not gm_Attack
   115         else if (Ammo^[CurSlot, CurAmmo].Propz and ammoprop_Power) = 0 then Message:= Message and not gm_Attack
   118         else if (Ammo^[CurSlot, CurAmmo].Propz and ammoprop_Power) = 0 then Message:= Message and not gm_Attack