Workaround for visual bug. Issue #442
authornemo
Sun, 28 Oct 2012 11:04:03 -0400
changeset 7856 70c086d9b03f
parent 7854 0b447175594f
child 7858 2566fc2621d4
Workaround for visual bug. issue #442
hedgewars/uGearsRender.pas
--- a/hedgewars/uGearsRender.pas	Sun Oct 28 04:57:11 2012 +0100
+++ b/hedgewars/uGearsRender.pas	Sun Oct 28 11:04:03 2012 -0400
@@ -316,7 +316,13 @@
                     lx:= lx + ax;
                     ly:= ly + ay;
                     tx:= round(lx);
-                    ty:= round(ly)
+                    ty:= round(ly);
+                    if (abs(tx-hx) > 1000) or (abs(hy-ty) > 1000) then
+                        begin
+                        DrawLine(hx, hy, tx, ty, 1.0, $FF, $00, $00, $C0);
+                        hx:= tx;
+                        hy:= ty
+                        end
                     end;
                 // reached edge of land. assume infinite beam. Extend it way out past camera
                 if ((ty and LAND_HEIGHT_MASK) <> 0) or ((tx and LAND_WIDTH_MASK) <> 0) then
@@ -326,6 +332,7 @@
                     end;
 
                 //if (abs(lx-tx)>8) or (abs(ly-ty)>8) then
+                if (tx <> hx) or (ty <> hy) then
                     begin
                     DrawLine(hx, hy, tx, ty, 1.0, $FF, $00, $00, $C0);
                     end;