Use gmDestroy message instead
authorunc0rr
Mon, 16 Jul 2012 23:12:59 +0400
changeset 7394 789d7831ec53
parent 7393 3f203c62353b
child 7395 d0d38cd0d27c
Use gmDestroy message instead
hedgewars/GSHandlers.inc
hedgewars/uGearsList.pas
--- a/hedgewars/GSHandlers.inc	Sun Jul 15 16:56:05 2012 -0400
+++ b/hedgewars/GSHandlers.inc	Mon Jul 16 23:12:59 2012 +0400
@@ -733,12 +733,14 @@
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepGrave(Gear: PGear);
 begin
-    if Gear^.Timer = 0 then
+    if (Gear^.Message and gmDestroy) <> 0 then
         begin
         DeleteGear(Gear);
         exit
         end;
+
     AllInactive := false;
+
     if Gear^.dY.isNegative then
         if TestCollisionY(Gear, -1) then
             Gear^.dY := _0;
@@ -5095,12 +5097,12 @@
                 resgear^.Hedgehog := graves.ar^[i]^.Hedgehog;
                 resgear^.Health := graves.ar^[i]^.Health;
                 PHedgehog(graves.ar^[i]^.Hedgehog)^.Gear := resgear;
-                graves.ar^[i]^.Timer:= 0;
+                graves.ar^[i]^.Message:= graves.ar^[i]^.Message or gmDestroy;
                 RenderHealth(resgear^.Hedgehog^);
                 RecountTeamHealth(resgear^.Hedgehog^.Team);
                 resgear^.Hedgehog^.Effects[heResurrected]:= 1;
                 // only make hat-less hedgehogs look like zombies, preserve existing hats
-                
+
                 if resgear^.Hedgehog^.Hat = 'NoHat' then
                     LoadHedgehogHat(resgear, 'Reserved/Zombie');
                 end;
--- a/hedgewars/uGearsList.pas	Sun Jul 15 16:56:05 2012 -0400
+++ b/hedgewars/uGearsList.pas	Mon Jul 16 23:12:59 2012 +0400
@@ -188,7 +188,6 @@
                 gear^.nImpactSounds:= 1;
                 gear^.Radius:= 10;
                 gear^.Elasticity:= _0_6;
-                gear^.Timer:= 1;
                 end;
          gtBee: begin
                 gear^.Radius:= 5;