1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-11-29 22:47:52 +02:00

Fix reset module

This commit is contained in:
Gerkiz
2025-02-23 16:34:14 +01:00
parent 5da8f095bb
commit 33238ac6a3
2 changed files with 10 additions and 3 deletions

View File

@@ -208,7 +208,7 @@ local function clear_robots(new_surface)
end
end
function Public.soft_reset_map(old_surface, map_gen_settings, player_starting_items, small_force_chunk)
function Public.soft_reset_map(old_surface, map_gen_settings, player_starting_items, small_force_chunk, delay)
if not this.original_surface_name then
this.original_surface_name = old_surface.name
end
@@ -220,6 +220,10 @@ function Public.soft_reset_map(old_surface, map_gen_settings, player_starting_it
new_surface.force_generate_chunk_requests()
end
if not delay then
teleport_players(new_surface, small_force_chunk)
end
reset_forces(new_surface, old_surface)
if player_starting_items then
equip_players(player_starting_items)
@@ -254,7 +258,10 @@ function Public.soft_reset_map(old_surface, map_gen_settings, player_starting_it
game.print(message, { r = 0.98, g = 0.66, b = 0.22 })
Server.to_discord_embed(message, true)
teleport_players(new_surface, small_force_chunk)
if delay then
teleport_players(new_surface, small_force_chunk)
end
return new_surface
end