Merge pull request #960 from argonui/nav-overlay

Nil handling for Navigation Overlay
This commit is contained in:
dscarpac 2024-11-03 13:38:07 -06:00 committed by GitHub
commit e3e35f2c80
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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]