Add compatibility with Planet Picker

This commit is contained in:
Simon Brodtmann 2025-02-15 01:26:54 +01:00
parent 59fda1cb7c
commit dca8ae4ec8
9 changed files with 251 additions and 220 deletions

View file

@ -62,6 +62,7 @@ end
InitNew.on_init = function()
if game.tick > 0 then return end
if script.active_mods["planet-picker"] then return end
init_intro()
init_space_locations()

View file

@ -37,6 +37,7 @@ end
-- Initialize the freeplay scenario
local function init_freeplay(event)
if script.active_mods["planet-picker"] then return end
if storage.crashed_ship_lignumis then return end
local player = game.get_player(event.player_index)
@ -63,7 +64,9 @@ local function init_freeplay(event)
table.deepcopy(storage.crashed_ship_parts))
util.remove_safe(player, storage.crashed_ship_items)
util.remove_safe(player, storage.crashed_debris_items)
player.character.get_main_inventory().sort_and_merge()
if player.character then
player.character.get_main_inventory().sort_and_merge()
end
storage.crash_site_cutscene_active = true
crash_site.create_cutscene(player, { -5, -4 })