Skip to content

Commit

Permalink
Fix broken stuff
Browse files Browse the repository at this point in the history
Locomotive is invalid when the run starts, therefore the game_over gets set to true, this is now fixed.
  • Loading branch information
Gerkiz committed Nov 11, 2024
1 parent 4748c23 commit d9059ca
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion maps/mountain_fortress_v3/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion maps/mountain_fortress_v3/locomotive.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion maps/mountain_fortress_v3/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion maps/mountain_fortress_v3/stateful/gui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d9059ca

Please sign in to comment.