Nil handling for Navigation Overlay

This commit is contained in:
Chr1Z93 2024-11-02 22:36:05 +01:00
parent 9b0a4f5090
commit 8be7a03446

View File

@ -320,7 +320,7 @@ function loadCamera(player, index, matColor)
local lookHere local lookHere
-- dynamic view of the play area -- 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 -- search the scripting zone on the play area for objects
local zone = guidReferenceApi.getObjectByOwnerAndType("Mythos", "PlayAreaZone") local zone = guidReferenceApi.getObjectByOwnerAndType("Mythos", "PlayAreaZone")
local bounds = getDynamicViewBounds(zone.getObjects()) local bounds = getDynamicViewBounds(zone.getObjects())
@ -331,7 +331,7 @@ function loadCamera(player, index, matColor)
distance = 0.8 * math.max(bounds.diffX, bounds.diffZ) + 7 distance = 0.8 * math.max(bounds.diffX, bounds.diffZ) + 7
} }
-- dynamic view of the clicked play mat -- 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) -- maybe get matColor (mat index 1 - 4)
matColor = matColor or matColorList[index - 2] matColor = matColor or matColorList[index - 2]