From d9059ca14d887d51c7725e9817ad82e0cbde8368 Mon Sep 17 00:00:00 2001 From: Gerkiz Date: Mon, 11 Nov 2024 14:25:14 +0100 Subject: [PATCH] Fix broken stuff Locomotive is invalid when the run starts, therefore the game_over gets set to true, this is now fixed. --- maps/mountain_fortress_v3/functions.lua | 2 +- maps/mountain_fortress_v3/locomotive.lua | 1 - maps/mountain_fortress_v3/main.lua | 1 - maps/mountain_fortress_v3/stateful/gui.lua | 1 - 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/maps/mountain_fortress_v3/functions.lua b/maps/mountain_fortress_v3/functions.lua index c6b4a059..813d6876 100644 --- a/maps/mountain_fortress_v3/functions.lua +++ b/maps/mountain_fortress_v3/functions.lua @@ -2847,7 +2847,7 @@ function Public.equip_players(starting_items, recreate) local equip = prototypes.equipment[item] if equip then local p_armor = player.get_inventory(defines.inventory.character_armor) - if p_armor and p_armor.valid and p_armor[1] and p_armor[1].grid then + if p_armor and p_armor.valid and p_armor[1] and p_armor[1].valid_for_read and p_armor[1].grid and p_armor[1].grid.valid then for _ = 1, item_data.count do p_armor[1].grid.put({ name = item }) end diff --git a/maps/mountain_fortress_v3/locomotive.lua b/maps/mountain_fortress_v3/locomotive.lua index d8351393..f1f841a9 100644 --- a/maps/mountain_fortress_v3/locomotive.lua +++ b/maps/mountain_fortress_v3/locomotive.lua @@ -478,7 +478,6 @@ local function set_locomotive_health() local locomotive = Public.get('locomotive') if not locomotive or not locomotive.valid then - Public.game_is_over() return end diff --git a/maps/mountain_fortress_v3/main.lua b/maps/mountain_fortress_v3/main.lua index 9a85c374..8b1163e4 100644 --- a/maps/mountain_fortress_v3/main.lua +++ b/maps/mountain_fortress_v3/main.lua @@ -106,7 +106,6 @@ local is_locomotive_valid = function () local locomotive = Public.get('locomotive') if game.ticks_played < 1000 then return end if not locomotive or not locomotive.valid then - Public.set('game_lost', true) Public.game_is_over() end end diff --git a/maps/mountain_fortress_v3/stateful/gui.lua b/maps/mountain_fortress_v3/stateful/gui.lua index efa718e8..c03cd8e1 100644 --- a/maps/mountain_fortress_v3/stateful/gui.lua +++ b/maps/mountain_fortress_v3/stateful/gui.lua @@ -384,7 +384,6 @@ local function objective_frames(player, stateful, player_frame, objective, data) local objective_locale_right_label = right_flow.add({ type = 'label', caption = objective_locale_right, tooltip = tooltip_right }) data.random_objectives[#data.random_objectives + 1] = { name = objective_name, frame = objective_locale_right_label } - return end local function buff_window(player)