From 13852fa2ede944ce30ab156c882082060b425fd1 Mon Sep 17 00:00:00 2001 From: David Schwietering Date: Fri, 6 Dec 2024 15:49:23 +0100 Subject: [PATCH] Stupid map fix .. --- scripts/gui/CoursePlot.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/gui/CoursePlot.lua b/scripts/gui/CoursePlot.lua index 84cbb94ed..5c2a1953e 100644 --- a/scripts/gui/CoursePlot.lua +++ b/scripts/gui/CoursePlot.lua @@ -114,7 +114,11 @@ function CoursePlot:drawLineBetween(map, x, z, nx, nz, isHudMap, lineThickness, local endX, endY, _, ev = CpGuiUtil.worldToScreen(map, nx, nz, isHudMap) local dx, dz = nx - x, nz - z local length = MathUtil.vector2Length(dx, dz) - local dirX, dirZ = length > 0 and MathUtil.vector2Normalize(dx, dz) or 0, 1 + local dirX, dirZ = 0, 1 + if length <= 0 then + return + end + dirX, dirZ = MathUtil.vector2Normalize(dx, dz) if startX and startY and endX and endY then local dx2D = endX - startX local dy2D = ( endY - startY ) / g_screenAspectRatio