# HG changeset patch # User nemo # Date 1547496675 18000 # Node ID 9c03b3cd6d16e8a11e1b38673e083a466ffef223 # Parent e27f1d1c1da9e93f419e5d3bf7280f759bde5f2d just focus on the unsafe deletes in a hopefully branch-safe fashion diff -r e27f1d1c1da9 -r 9c03b3cd6d16 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);