just focus on the unsafe deletes in a hopefully branch-safe fashion 0.9.25
authornemo
Mon, 14 Jan 2019 15:11:15 -0500
branch0.9.25
changeset 14589 9c03b3cd6d16
parent 14588 e27f1d1c1da9
child 15329 35e976e48b0b
child 15333 c4d68ab7aecb
just focus on the unsafe deletes in a hopefully branch-safe fashion
hedgewars/uGearsHandlersMess.pas
--- a/hedgewars/uGearsHandlersMess.pas	Mon Jan 14 15:01:43 2019 -0500
+++ b/hedgewars/uGearsHandlersMess.pas	Mon Jan 14 15:11:15 2019 -0500
@@ -2081,7 +2081,8 @@
                     hwRound(Gear^.X) - SpritesData[sprFrozenAirMine].Width div 2,
                     hwRound(Gear^.Y) - SpritesData[sprFrozenAirMine].Height div 2,
                     sprFrozenAirMine, 0, 0, false, false, false, false);
-            DeleteGear(Gear)
+            DeleteGear(Gear);
+            exit
             end;
         doStepFallingGear(Gear);
         exit
@@ -2435,6 +2436,7 @@
 procedure doStepCase(Gear: PGear);
 var
     i, x, y: LongInt;
+    Boom: LongWord;
     k: TGearType;
     dX, dY: HWFloat;
     hog: PHedgehog;
@@ -2460,13 +2462,13 @@
         x := hwRound(Gear^.X);
         y := hwRound(Gear^.Y);
         hog:= Gear^.Hedgehog;
-
+        Boom:= Gear^.Boom;
         DeleteGear(Gear);
         // <-- delete gear!
 
         if k = gtCase then
             begin
-            doMakeExplosion(x, y, Gear^.Boom, hog, EXPLAutoSound);
+            doMakeExplosion(x, y, Boom, hog, EXPLAutoSound);
             for i:= 0 to 63 do
                 AddGear(x, y, gtFlame, 0, _0, _0, 0);
             end
@@ -2474,7 +2476,7 @@
             uStats.TargetHit()
         else if k = gtExplosives then
                 begin
-                doMakeExplosion(x, y, Gear^.Boom, hog, EXPLAutoSound);
+                doMakeExplosion(x, y, Boom, hog, EXPLAutoSound);
                 for i:= 0 to 31 do
                     begin
                     dX := AngleCos(i * 64) * _0_5 * (getrandomf + _1);