Remove enemies from starting area when leaving Lignumis

This commit is contained in:
Simon Brodtmann 2025-09-28 11:36:00 +02:00
parent 429e8a3a41
commit 74eb162d9a

View file

@ -25,6 +25,21 @@ local function init_nauvis()
end
-- Removes enemies around the crash site to not mess with the player start
local function clear_enemies()
local nauvis = game.planets[storage.target_planet].surface
local enemies = nauvis.find_entities_filtered({
position = { 0, 0 },
radius = 200,
force = "enemy"
})
for _, enemy in pairs(enemies) do
enemy.destroy()
end
end
-- Teleport player to Nauvis and show welcome message
local function teleport_player(player)
local nauvis = game.planets[storage.target_planet].surface
@ -67,6 +82,7 @@ local function transit_player(player_index)
end
init_nauvis()
clear_enemies()
teleport_player(player)
init_freeplay()