hedgewars/uGearsHedgehog.pas
changeset 7459 8511a3f899d3
parent 7426 55b49cc1f33a
child 7462 9cc5a2586978
equal deleted inserted replaced
7456:823bd65ef095 7459:8511a3f899d3
   453 end;
   453 end;
   454 
   454 
   455 procedure AfterAttack;
   455 procedure AfterAttack;
   456 var s: shortstring;
   456 var s: shortstring;
   457     a: TAmmoType;
   457     a: TAmmoType;
   458 begin
   458     HHGear: PGear;
   459 with CurrentHedgehog^.Gear^, CurrentHedgehog^ do
   459 begin
   460     begin
   460 with CurrentHedgehog^ do
       
   461     begin
       
   462     HHGear:= Gear;
   461     a:= CurAmmoType;
   463     a:= CurAmmoType;
   462     State:= State and (not gstAttacking);
   464     if HHGear <> nil then HHGear^.State:= HHGear^.State and (not gstAttacking);
   463     if (Ammoz[a].Ammo.Propz and ammoprop_Effect) = 0 then
   465     if (Ammoz[a].Ammo.Propz and ammoprop_Effect) = 0 then
   464         begin
   466         begin
   465         Inc(MultiShootAttacks);
   467         Inc(MultiShootAttacks);
   466         
   468         
   467         if (Ammoz[a].Ammo.NumPerTurn >= MultiShootAttacks) then
   469         if (Ammoz[a].Ammo.NumPerTurn >= MultiShootAttacks) then
   482                 begin
   484                 begin
   483                 if TagTurnTimeLeft = 0 then
   485                 if TagTurnTimeLeft = 0 then
   484                     TagTurnTimeLeft:= TurnTimeLeft;
   486                     TagTurnTimeLeft:= TurnTimeLeft;
   485                 TurnTimeLeft:=(Ammoz[a].TimeAfterTurn * cGetAwayTime) div 100;
   487                 TurnTimeLeft:=(Ammoz[a].TimeAfterTurn * cGetAwayTime) div 100;
   486                 end;
   488                 end;
   487             if ((Ammoz[a].Ammo.Propz and ammoprop_NoRoundEnd) = 0) then
   489             if ((Ammoz[a].Ammo.Propz and ammoprop_NoRoundEnd) = 0) and (HHGear <> nil) then 
   488                 State:= State or gstAttacked;
   490                 HHGear^.State:= HHGear^.State and (not gstAttacked);
   489             if (Ammoz[a].Ammo.Propz and ammoprop_NoRoundEnd) <> 0 then
   491             if (Ammoz[a].Ammo.Propz and ammoprop_NoRoundEnd) <> 0 then
   490                 ApplyAmmoChanges(CurrentHedgehog^)
   492                 ApplyAmmoChanges(CurrentHedgehog^)
   491             end;
   493             end;
   492         end
   494         end
   493     else
   495     else