merge
authornemo
Fri, 05 Aug 2011 14:15:19 -0400
changeset 5501 0ba2dca673e6
parent 5498 fac3c15707d2 (diff)
parent 5493 49769489af37 (current diff)
child 5503 d8632f589008
merge
hedgewars/uGears.pas
--- a/hedgewars/GSHandlers.inc	Fri Aug 05 12:19:01 2011 +0100
+++ b/hedgewars/GSHandlers.inc	Fri Aug 05 14:15:19 2011 -0400
@@ -257,16 +257,14 @@
     AllInactive := false;
     Gear^.Y := Gear^.Y + cDrownSpeed;
     Gear^.X := Gear^.X + Gear^.dX * cDrownSpeed;
-    if (not SuddenDeathDmg and (cWaterOpacity > $FE)) or (SuddenDeathDmg and (cSDWaterOpacity > $FE)) or (hwRound(Gear^.Y) > Gear^.Radius + cWaterLine + cVisibleWater) then
-        DeleteGear(Gear);
     // Create some bubbles (0.5% might be better but causes too few bubbles sometimes)
     if ((not SuddenDeathDmg and (cWaterOpacity < $FF)) or (SuddenDeathDmg and (cSDWaterOpacity < $FF))) and ((GameTicks and $1F) = 0) then
         if (Gear^.Kind = gtHedgehog) and (Random(4) = 0) then
-            AddVisualGear(hwRound(Gear^.X) - Gear^.Radius, hwRound(Gear^.Y) - Gear^.Radius,
-            vgtBubble)
+            AddVisualGear(hwRound(Gear^.X) - Gear^.Radius, hwRound(Gear^.Y) - Gear^.Radius, vgtBubble)
     else if Random(12) = 0 then
-             AddVisualGear(hwRound(Gear^.X) - Gear^.Radius, hwRound(Gear^.Y) - Gear^.Radius,
-             vgtBubble)
+             AddVisualGear(hwRound(Gear^.X) - Gear^.Radius, hwRound(Gear^.Y) - Gear^.Radius, vgtBubble);
+    if (not SuddenDeathDmg and (cWaterOpacity > $FE)) or (SuddenDeathDmg and (cSDWaterOpacity > $FE)) or (hwRound(Gear^.Y) > Gear^.Radius + cWaterLine + cVisibleWater) then
+        DeleteGear(Gear);
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
--- a/hedgewars/uGears.pas	Fri Aug 05 12:19:01 2011 +0100
+++ b/hedgewars/uGears.pas	Fri Aug 05 14:15:19 2011 -0400
@@ -332,7 +332,7 @@
         gtMine: begin
                 gear^.ImpactSound:= sndMineImpact;
                 gear^.nImpactSounds:= 1;
-		        gear^.Health:= 10;
+                gear^.Health:= 10;
                 gear^.State:= gear^.State or gstMoving;
                 gear^.Radius:= 2;
                 gear^.Elasticity:= _0_55;
@@ -914,7 +914,7 @@
         begin
         dec(delay2);
 
-        if ((delay2 mod cInactDelay) = 0) and (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) then 
+        if ((delay2 mod cInactDelay) = 0) and (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) then
             CurrentHedgehog^.Gear^.State:= CurrentHedgehog^.Gear^.State and not gstAttacked;
         if delay2 = 0 then
             begin
@@ -1591,7 +1591,6 @@
 begin
     gear^.dX := _0;
     gear^.dY := _0;
-    gear^.State := gstWait;
     gear^.Damage := 0;
     gear^.Health := gear^.Hedgehog^.InitialHealth;
     gear^.Hedgehog^.Effects[hePoisoned] := false;
@@ -1608,6 +1607,7 @@
     if gear <> nil then begin
         RenderHealth(gear^.Hedgehog^);
         ScriptCall('onGearResurrect', gear^.uid);
+        gear^.State := gstWait;
     end;
     RecountTeamHealth(tempTeam);
 end;