Make spectator markers a constant

This commit is contained in:
2026-03-08 14:32:54 -05:00
parent 2244f6494b
commit c820748eca
2 changed files with 24 additions and 17 deletions

View File

@@ -24,9 +24,15 @@ function SkirmishGameClass:New(gameMode)
local function FindSpectators()
---@type SpectatorStruct[]
local spectators = {}
local spectatorMarker = GetSpectatorMarkerName(gameMode)
local spectatorMarker = nil
if spectatorMarker ~= nil then
if StringCompare(gameMode, "Space") then
spectatorMarker = Spectator_Marker_Space
elseif StringCompare(gameMode, "Land") then
spectatorMarker = Spectator_Marker_Land
end
if spectatorMarker then
for k, marker in pairs(Find_All_Objects_Of_Type(spectatorMarker)) do
local playerWrapper = marker.Get_Owner()
local playerId = playerWrapper.Get_ID()