From 5c45d79ae071fedcd5c4a130bddddec791fa6be1 Mon Sep 17 00:00:00 2001 From: hanakocz Date: Mon, 11 Dec 2023 21:29:30 +0100 Subject: [PATCH] hotfix for ddosing the db + bottom butons enabled --- maps/journey/functions.lua | 11 ++++++++++- maps/journey/main.lua | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/maps/journey/functions.lua b/maps/journey/functions.lua index 5805f8c9..7d4d1fd5 100644 --- a/maps/journey/functions.lua +++ b/maps/journey/functions.lua @@ -2,6 +2,9 @@ local Map_functions = require 'tools.map_functions' local Server = require 'utils.server' local Get_noise = require 'utils.get_noise' +local Autostash = require 'modules.autostash' +local Misc = require 'utils.commands.misc' +local BottomFrame = require 'utils.gui.bottom_frame' local Constants = require 'maps.journey.constants' local Unique_modifiers = require 'maps.journey.unique_modifiers' local Vacants = require 'modules.clear_vacant_players' @@ -449,7 +452,7 @@ end local function check_if_restarted(journey) local secs = Server.get_current_time() - if not secs then + if not secs or journey.import_checked then return else Server.try_get_data('scenario_settings', 'journey_updating', journey.check_import) @@ -476,6 +479,11 @@ function Public.hard_reset(journey) return end Vacants.reset() + BottomFrame.activate_custom_buttons(true) + BottomFrame.reset() + Autostash.insert_into_furnace(true) + Autostash.bottom_button(true) + Misc.bottom_button(true) if game.surfaces.mothership and game.surfaces.mothership.valid then game.delete_surface(game.surfaces.mothership) end @@ -1126,6 +1134,7 @@ function Public.mothership_arrives_at_world(journey) journey.beacon_objective_resistance = 0.90 - (0.03 * journey.world_number) journey.emergency_triggered = false journey.emergency_selected = false + journey.import_checked = false draw_background(journey, surface) Public.update_tooltips(journey) end diff --git a/maps/journey/main.lua b/maps/journey/main.lua index 21491166..072675f6 100644 --- a/maps/journey/main.lua +++ b/maps/journey/main.lua @@ -217,6 +217,7 @@ local function check_import(data) if data.key ~= 'journey_updating' then return end + journey.import_checked = true local importing = data.value if importing then Functions.import_journey(journey)