This commit is contained in:
2025-04-21 14:37:30 +09:00
parent ee2b2b429d
commit 41dd7517d8

View File

@@ -10,7 +10,7 @@ Storage.register(turrets, function(tbl)
turrets = tbl turrets = tbl
end) end)
do local function spawn_force()
local force = game.forces["spawn"] local force = game.forces["spawn"]
if force and force.valid then if force and force.valid then
@@ -49,6 +49,8 @@ end
-- Will spawn all infinite ammo turrets and keep them refilled -- Will spawn all infinite ammo turrets and keep them refilled
local function spawn_turrets() local function spawn_turrets()
spawn_force()
for _, turret_pos in pairs(turrets) do for _, turret_pos in pairs(turrets) do
local surface = game.surfaces[turret_pos.surface] local surface = game.surfaces[turret_pos.surface]
local pos = turret_pos.position local pos = turret_pos.position