mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 11:35:22 +09:00
.
This commit is contained in:
@@ -20,15 +20,6 @@ for _, turret in ipairs(turrets) do
|
|||||||
turret.position = apply_offset(turret.position, config.turrets.offset)
|
turret.position = apply_offset(turret.position, config.turrets.offset)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Get or create the force used for entities in spawn
|
|
||||||
local function get_neutral_force()
|
|
||||||
local force = game.forces["neutral"]
|
|
||||||
|
|
||||||
if force and force.valid then
|
|
||||||
return force
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Protects an entity
|
-- Protects an entity
|
||||||
-- and sets its force to the spawn force
|
-- and sets its force to the spawn force
|
||||||
local function protect_entity(entity, set_force)
|
local function protect_entity(entity, set_force)
|
||||||
@@ -39,7 +30,7 @@ local function protect_entity(entity, set_force)
|
|||||||
entity.operable = false
|
entity.operable = false
|
||||||
|
|
||||||
if set_force then
|
if set_force then
|
||||||
entity.force = get_neutral_force()
|
entity.force = game.forces["neutral"]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user