From 8be7a0344645e1befd9553e3f81621b80c76cece Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Sat, 2 Nov 2024 22:36:05 +0100 Subject: [PATCH] Nil handling for Navigation Overlay --- src/core/NavigationOverlayHandler.ttslua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/NavigationOverlayHandler.ttslua b/src/core/NavigationOverlayHandler.ttslua index 0dd28d71..01441876 100644 --- a/src/core/NavigationOverlayHandler.ttslua +++ b/src/core/NavigationOverlayHandler.ttslua @@ -320,7 +320,7 @@ function loadCamera(player, index, matColor) local lookHere -- dynamic view of the play area - if index == 2 then + if index and index == 2 then -- search the scripting zone on the play area for objects local zone = guidReferenceApi.getObjectByOwnerAndType("Mythos", "PlayAreaZone") local bounds = getDynamicViewBounds(zone.getObjects()) @@ -331,7 +331,7 @@ function loadCamera(player, index, matColor) distance = 0.8 * math.max(bounds.diffX, bounds.diffZ) + 7 } -- dynamic view of the clicked play mat - elseif (index >= 3 and index <= 6) or matColor then + elseif (index and index >= 3 and index <= 6) or matColor then -- maybe get matColor (mat index 1 - 4) matColor = matColor or matColorList[index - 2]