Fix crash site being created for every player in multiplayer

This commit is contained in:
Simon Brodtmann 2025-02-05 14:21:14 +01:00
parent 6ea238ca32
commit 2d004b4fb6
3 changed files with 6 additions and 0 deletions

View file

@ -3,6 +3,7 @@ Version: 1.0.11
Date: 05.02.2025 Date: 05.02.2025
Bug Fixes: Bug Fixes:
- The player can now craft generated quality crafting categories - The player can now craft generated quality crafting categories
- Fix crash site being created for every player in multiplayer
--------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------
Version: 1.0.10 Version: 1.0.10
Date: 05.02.2025 Date: 05.02.2025

View file

@ -37,10 +37,13 @@ end
-- Initialize the freeplay scenario -- Initialize the freeplay scenario
local function init_freeplay(event) local function init_freeplay(event)
if storage.crashed_ship_lignumis then return end
local player = game.get_player(event.player_index) local player = game.get_player(event.player_index)
if not player or not remote.interfaces.freeplay then return end if not player or not remote.interfaces.freeplay then return end
storage.crashed_ship_lignumis = true
local surface = storage.surface or game.planets["lignumis"].surface local surface = storage.surface or game.planets["lignumis"].surface
storage.crashed_ship_items = remote.call("freeplay", "get_ship_items") storage.crashed_ship_items = remote.call("freeplay", "get_ship_items")
storage.crashed_debris_items = remote.call("freeplay", "get_debris_items") storage.crashed_debris_items = remote.call("freeplay", "get_debris_items")

View file

@ -40,8 +40,10 @@ end
-- Initialize the Nauvis freeplay scenario -- Initialize the Nauvis freeplay scenario
local function init_freeplay() local function init_freeplay()
if storage.crashed_ship_nauvis then return end
if not remote.interfaces.freeplay then return end if not remote.interfaces.freeplay then return end
storage.crashed_ship_nauvis = true
local nauvis = game.planets["nauvis"].surface local nauvis = game.planets["nauvis"].surface
local ship_items = { local ship_items = {
["burner-mining-drill"] = 2, ["burner-mining-drill"] = 2,