Fix freezer failing to freeze gears with negative coordinate
authorWuzzy <Wuzzy2@mail.ru>
Thu, 29 Nov 2018 20:09:01 +0100
changeset 14347 1dcc37b6913e
parent 14346 22c91ac48d38
child 14348 ffebbcc40c9b
Fix freezer failing to freeze gears with negative coordinate
hedgewars/uGearsHandlersMess.pas
--- a/hedgewars/uGearsHandlersMess.pas	Thu Nov 29 19:06:33 2018 +0100
+++ b/hedgewars/uGearsHandlersMess.pas	Thu Nov 29 20:09:01 2018 +0100
@@ -6432,7 +6432,7 @@
                         begin
                         if (iter^.State and gstFrozen = 0) and
                            ((iter^.Kind = gtExplosives) or (iter^.Kind = gtAirMine) or (iter^.Kind = gtCase) or (iter^.Kind = gtMine) or (iter^.Kind = gtSMine)) and
-                           (abs(LongInt(iter^.X.Round) - target.x) + abs(LongInt(iter^.Y.Round) - target.y) + 2 < 2 * iceRadius)
+                           (abs(hwRound(iter^.X) - target.x) + abs(hwRound(iter^.Y) - target.y) + 2 < 2 * iceRadius)
                            and (Distance(iter^.X - int2hwFloat(target.x), iter^.Y - int2hwFloat(target.y)) < int2hwFloat(iceRadius * 2)) then
                             begin
                             for t:= 0 to 5 do