All luals findings solved
PR Prerequisites / Lua Check (pull_request) Failing after 22s
PR Prerequisites / Bundles Without Errors (pull_request) Failing after 23s

This commit is contained in:
2026-09-19 22:27:57 +02:00
parent 5ec7d18fa8
commit 05d47aa969
35 changed files with 356 additions and 149 deletions
+13 -9
View File
@@ -16,11 +16,11 @@ SpawnManager.__index = SpawnManager
---@field uncontrolled boolean? Sets the group to be uncontrolled on spawn
---@param logger Logger
---@return SpawnManager
function SpawnManager.new(logger)
local self = setmetatable({}, SpawnManager)
self._logger = logger
self._persistedUnits = {} -- Stores units that should be persisted by name
return self
@@ -133,8 +133,9 @@ do --- privates
]]
if spawnTemplate and spawnTemplate["units"] then
for _, unit in pairs(spawnTemplate["units"]) do
local name = unit["name"]
local units = spawnTemplate["units"] --[[@as Array<table>]]
for _, unit in pairs(units) do
local name = unit["name"] --[[@as string]]
SpearheadEvents.addOnUnitLostEventListener(name, self)
local state = Persistence.UnitState(name)
@@ -146,16 +147,17 @@ do --- privates
if override and override.emptyLoadouts == true then
if unit["payload"] and unit["payload"]["pylons"] then
unit["payload"]["pylons"] = {}
local payload = unit["payload"] --[[@as table]]
payload["pylons"] = {} --[[@as table]]
end
end
if unit["parking"] then
unit["parking_landing"] = unit["parking"]
unit["parking_landing"] = unit["parking"] --[[@as number]]
end
if unit["parking_id"] then
unit["parking_landing_id"] = unit["parking_id"]
unit["parking_landing_id"] = unit["parking_id"] --[[@as number]]
end
end
@@ -210,9 +212,11 @@ do --- privates
spawnTemplate["x"] = persistentState.pos.x
spawnTemplate["y"] = persistentState.pos.z
if spawnTemplate["units"] and spawnTemplate["units"][1] then
spawnTemplate["units"][1]["x"] = persistentState.pos.x
spawnTemplate["units"][1]["y"] = persistentState.pos.z
spawnTemplate["units"][1]["heading"] = persistentState.heading or 0
local units = spawnTemplate["units"] --[[@as Array<table>]]
local firstUnit = units[1] --[[@as table]]
firstUnit["x"] = persistentState.pos.x --[[@as number]]
firstUnit["y"] = persistentState.pos.z --[[@as number]]
firstUnit["heading"] = persistentState.heading or 0 --[[@as number]]
end
end
end