Fix bug in resurrector deleting graves (exists in stable too), remove some unnecessary assignments due to the fillchar 0
authornemo
Sun, 15 Jul 2012 16:56:05 -0400
changeset 7393 3f203c62353b
parent 7391 588eabb4b384
child 7394 789d7831ec53
Fix bug in resurrector deleting graves (exists in stable too), remove some unnecessary assignments due to the fillchar 0
hedgewars/GSHandlers.inc
hedgewars/uGearsList.pas
--- a/hedgewars/GSHandlers.inc	Sun Jul 15 15:35:28 2012 -0400
+++ b/hedgewars/GSHandlers.inc	Sun Jul 15 16:56:05 2012 -0400
@@ -733,6 +733,11 @@
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepGrave(Gear: PGear);
 begin
+    if Gear^.Timer = 0 then
+        begin
+        DeleteGear(Gear);
+        exit
+        end;
     AllInactive := false;
     if Gear^.dY.isNegative then
         if TestCollisionY(Gear, -1) then
@@ -5090,7 +5095,7 @@
                 resgear^.Hedgehog := graves.ar^[i]^.Hedgehog;
                 resgear^.Health := graves.ar^[i]^.Health;
                 PHedgehog(graves.ar^[i]^.Hedgehog)^.Gear := resgear;
-                DeleteGear(graves.ar^[i]);
+                graves.ar^[i]^.Timer:= 0;
                 RenderHealth(resgear^.Hedgehog^);
                 RecountTeamHealth(resgear^.Hedgehog^.Team);
                 resgear^.Hedgehog^.Effects[heResurrected]:= 1;
--- a/hedgewars/uGearsList.pas	Sun Jul 15 15:35:28 2012 -0400
+++ b/hedgewars/uGearsList.pas	Sun Jul 15 16:56:05 2012 -0400
@@ -92,16 +92,13 @@
 gear^.doStep:= doStepHandlers[Kind];
 gear^.CollisionIndex:= -1;
 gear^.Timer:= Timer;
-gear^.FlightTime:= 0;
 gear^.uid:= GCounter;
 gear^.SoundChannel:= -1;
 gear^.ImpactSound:= sndNone;
-gear^.nImpactSounds:= 0;
 gear^.Density:= _1;
 // Define ammo association, if any.
 gear^.AmmoType:= GearKindAmmoTypeMap[Kind];
 gear^.CollisionMask:= $FFFF;
-gear^.Power:= 0;
 
 if CurrentHedgehog <> nil then gear^.Hedgehog:= CurrentHedgehog;
 
@@ -191,6 +188,7 @@
                 gear^.nImpactSounds:= 1;
                 gear^.Radius:= 10;
                 gear^.Elasticity:= _0_6;
+                gear^.Timer:= 1;
                 end;
          gtBee: begin
                 gear^.Radius:= 5;