allow freezing airmines outside the Land area too. Make the top of frozen mine a little flatter
authornemo
Sun, 27 May 2018 20:32:06 -0400
changeset 13406 6a3f94fe2636
parent 13405 4c813650fe17
child 13407 06792533ef91
allow freezing airmines outside the Land area too. Make the top of frozen mine a little flatter
hedgewars/uGearsHandlersMess.pas
share/hedgewars/Data/Graphics/FrozenAirMine.png
--- a/hedgewars/uGearsHandlersMess.pas	Sun May 27 13:10:32 2018 -0400
+++ b/hedgewars/uGearsHandlersMess.pas	Sun May 27 20:32:06 2018 -0400
@@ -6263,8 +6263,16 @@
                                 end
                             else if iter^.Kind = gtAirMine then
                                 begin
-								ForcePlaceOnLand(hwRound(iter^.X)-16, hwRound(iter^.Y)-16, sprFrozenAirMine, 0, lfIce, $FFFFFFFF, false, false, false);
-								iter^.State:= gstFrozen or gstInvisible;
+								iter^.Damage:= 0;
+								iter^.State:= iter^.State or gstFrozen;
+								if (hwRound(iter^.X) < RightX) and (hwRound(iter^.X) > 0) and 
+									(hwRound(iter^.Y) < LAND_HEIGHT) and (hwRound(iter^.Y) > 0) then
+									begin
+									iter^.X:= int2hwFloat(min(RightX-16,max(hwRound(iter^.X), 16)));
+									iter^.Y:= int2hwFloat(min(LAND_HEIGHT-16,max(hwRound(iter^.Y),16)));
+									ForcePlaceOnLand(hwRound(iter^.X)-16, hwRound(iter^.Y)-16, sprFrozenAirMine, 0, lfIce, $FFFFFFFF, false, false, false);	
+									iter^.State:= iter^.State or gstInvisible
+									end
                                 end
                             else // gtExplosives
                                 begin
Binary file share/hedgewars/Data/Graphics/FrozenAirMine.png has changed