better?
authornemo
Sun, 11 Sep 2011 13:12:52 -0400
changeset 5862 b4229b0abc70
parent 5861 b102aa6a853e
child 5863 cea9ac437839
better?
hedgewars/uGears.pas
hedgewars/uWorld.pas
--- a/hedgewars/uGears.pas	Sun Sep 11 18:57:54 2011 +0200
+++ b/hedgewars/uGears.pas	Sun Sep 11 13:12:52 2011 -0400
@@ -603,6 +603,7 @@
 else if Gear^.Kind = gtHedgehog then
     if (CurAmmoGear <> nil) and (CurrentHedgehog^.Gear = Gear) then
         begin
+        AttackBar:= 0;
         Gear^.Message:= gmDestroy;
         CurAmmoGear^.Message:= gmDestroy;
         exit
@@ -620,6 +621,7 @@
         team:= Gear^.Hedgehog^.Team;
         if CurrentHedgehog^.Gear = Gear then
             begin
+            AttackBar:= 0;
             FreeActionsList; // to avoid ThinkThread on drawned gear
             if ((Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NoRoundEnd) <> 0) and (CurrentHedgehog^.MultiShootAttacks > 0) then OnUsedAmmo(CurrentHedgehog^);
             end;
@@ -1012,7 +1014,6 @@
 var  i: LongInt;
      t: PGear;
 begin
-    AttackBar:= 0;  // rare case where they drowned while attacking
     SpeechText:= ''; // in case it has not been consumed
 
     if (GameFlags and gfLowGravity) = 0 then
--- a/hedgewars/uWorld.pas	Sun Sep 11 18:57:54 2011 +0200
+++ b/hedgewars/uWorld.pas	Sun Sep 11 13:12:52 2011 -0400
@@ -802,7 +802,7 @@
     DrawWater(255, 0);
 
 // Attack bar
-    if (CurrentTeam <> nil) and (CurrentHedgehog^.Gear <> nil) then
+    if CurrentTeam <> nil then
         case AttackBar of
 (*        1: begin
         r:= StuffPoz[sPowerBar];