hedgewars/uGearsUtils.pas
changeset 12605 ef780eda6e48
parent 12454 8c5475bb4db7
child 12626 d972b31f8881
--- a/hedgewars/uGearsUtils.pas	Fri Sep 29 23:31:29 2017 +0200
+++ b/hedgewars/uGearsUtils.pas	Sat Sep 30 00:09:48 2017 +0200
@@ -709,10 +709,10 @@
                     if isDirH then
                         begin
                         tmp:= hwRound(Gear^.X - Gear^.dX);
-                        if abs(tmp - leftX) < abs(tmp - rightX) then  // left edge
-                            isImpact:= (abs(tmp-leftX) >= Gear^.Radius) and (Gear^.dX.isNegative)
+                        if abs(tmp - real(leftX)) < abs(tmp - real(rightX)) then  // left edge
+                            isImpact:= (abs(tmp-real(leftX)) >= Gear^.Radius) and (Gear^.dX.isNegative)
                         else
-                            isImpact:= (abs(tmp-rightX) >= Gear^.Radius) and (not Gear^.dX.isNegative);
+                            isImpact:= (abs(tmp-real(rightX)) >= Gear^.Radius) and (not Gear^.dX.isNegative);
                         end
                     else
                         begin