Do not call AddCI when air mine is frozen without creating land
authorWuzzy <Wuzzy2@mail.ru>
Thu, 29 Nov 2018 19:06:33 +0100
changeset 14367 22c91ac48d38
parent 14366 ef7501d9935c
child 14368 1dcc37b6913e
Do not call AddCI when air mine is frozen without creating land I.e. when it is frozen out of land bounds.
hedgewars/uGearsHandlersMess.pas
--- a/hedgewars/uGearsHandlersMess.pas	Thu Nov 29 18:54:31 2018 +0100
+++ b/hedgewars/uGearsHandlersMess.pas	Thu Nov 29 19:06:33 2018 +0100
@@ -6479,10 +6479,10 @@
                                 begin
                                 iter^.Damage:= 0;
                                 iter^.State:= iter^.State or gstFrozen;
-                                AddCI(iter);
                                 if (hwRound(iter^.X) < RightX-16) and (hwRound(iter^.X) > LeftX+16) and 
                                     (hwRound(iter^.Y) > topY+16) and (hwRound(iter^.Y) < LAND_HEIGHT-16) then
                                     begin
+                                    AddCI(iter);
 									iter^.X:= int2hwFloat(min(RightX-16,max(hwRound(iter^.X), LeftX+16)));
 									iter^.Y:= int2hwFloat(min(LAND_HEIGHT-16,max(hwRound(iter^.Y),TopY+16)));
                                     ForcePlaceOnLand(hwRound(iter^.X)-16, hwRound(iter^.Y)-16, sprFrozenAirMine, 0, lfIce, $FFFFFFFF, false, false, false);