Pixel-perfect removal of exploding frozen air mines
authorWuzzy <Wuzzy2@mail.ru>
Thu, 29 Nov 2018 17:13:09 +0100
changeset 14343 2221c418026a
parent 14342 d738a03da740
child 14344 e3e06b216e00
Pixel-perfect removal of exploding frozen air mines
hedgewars/uGearsHandlersMess.pas
--- a/hedgewars/uGearsHandlersMess.pas	Thu Nov 29 10:56:06 2018 -0500
+++ b/hedgewars/uGearsHandlersMess.pas	Thu Nov 29 17:13:09 2018 +0100
@@ -2073,8 +2073,13 @@
         begin
         if Gear^.Damage > 0 then
             begin
-            doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), Gear^.Boom, Gear^.Hedgehog, EXPLAutoSound or EXPLDontDraw);
-            DrawExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), Gear^.Boom+1);
+            // Normal, damaging explosion
+            doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), Gear^.Boom, Gear^.Hedgehog, EXPLAutoSound);
+            // Remove land created by frozen air mine sprite pixel-perfectly
+            EraseLand(
+                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)
             end;
         doStepFallingGear(Gear);