From 2955b4ab3de3f98f8888f1affa0aa37d1ceff10f Mon Sep 17 00:00:00 2001 From: MewMew Date: Fri, 23 Aug 2019 14:41:32 +0200 Subject: [PATCH] fixes --- functions/soft_reset.lua | 8 +++++--- modules/trees_grow.lua | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/functions/soft_reset.lua b/functions/soft_reset.lua index a71461c1..ac51997f 100644 --- a/functions/soft_reset.lua +++ b/functions/soft_reset.lua @@ -1,6 +1,7 @@ local function reset_forces() for _, f in pairs(game.forces) do f.reset() + f.reset_evolution() end end @@ -51,11 +52,12 @@ function soft_reset_map(old_surface, map_gen_settings, player_starting_items) game.delete_surface(old_surface) + local message = table.concat({">> Welcome to ", global.original_surface_name, "!"}) if global.soft_reset_counter > 1 then - game.print(">> The world has been reshaped, welcome to " .. global.original_surface_name .. " number " .. tostring(global.soft_reset_counter) .. "!", {r=0.98, g=0.66, b=0.22}) - else - game.print(">> Welcome to " .. global.original_surface_name .. "!", {r=0.98, g=0.66, b=0.22}) + message = table.concat({">> The world has been reshaped, welcome to ", global.original_surface_name, " number ", tostring(global.soft_reset_counter), "!"}) end + game.print(message, {r=0.98, g=0.66, b=0.22}) + server_commands.to_discord_embed(message) return new_surface end \ No newline at end of file diff --git a/modules/trees_grow.lua b/modules/trees_grow.lua index 3b11ca82..d5ae79c9 100644 --- a/modules/trees_grow.lua +++ b/modules/trees_grow.lua @@ -95,7 +95,8 @@ local function on_chunk_charted(event) end local function tick(event) - local surface = game.players[1].surface + if not game.connected_players[1] then return end + local surface = game.connected_players[1].surface for a = 1, 32, 1 do if grow_trees(surface) then break end