Fix infinite loop in rendering of laser sight
authorunc0rr
Tue, 13 Dec 2022 21:21:55 +0100
changeset 15899 73cdc306888f
parent 15898 046182f1080b
child 15900 128ace913837
child 15908 4c0f8dbf6c13
child 15972 303cf91e5233
Fix infinite loop in rendering of laser sight
hedgewars/uGearsRender.pas
--- a/hedgewars/uGearsRender.pas	Fri Dec 09 08:18:50 2022 +0100
+++ b/hedgewars/uGearsRender.pas	Tue Dec 13 21:21:55 2022 +0100
@@ -558,7 +558,7 @@
                         ty:= round(ly + ay * (max(LAND_WIDTH,4096) div 2));
                         break;
                         end;
-                    if ((WorldEdge = weWrap) or (WorldEdge = weBounce)) and (ty < -cCamLimitY) and (ay < 0) then
+                    if ((WorldEdge = weWrap) or (WorldEdge = weBounce)) and ((ty < -cCamLimitY) or (ty >= TopY + cCamLimitY)) then
                         break;
 
                     if ((hogLR < 0) and (tx < LeftX)) or ((hogLR > 0) and (tx >= RightX)) then