1
0
mirror of https://github.com/Oarcinae/FactorioScenarioMultiplayerSpawn.git synced 2025-01-20 02:59:53 +02:00

Merge pull request #232 from Oarcinae/231-crash-on-player-left-game-when-loading-game

Fix critical crash in player left event when removing items.
This commit is contained in:
Oarcinae 2024-10-29 19:50:36 -04:00 committed by GitHub
commit d1ca209d86
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 1 deletions

View File

@ -1,4 +1,9 @@
---------------------------------------------------------------------------------------------------
Version: 2.1.4
Date: 2024-10-29
Bugfixes:
- Fix crash due to invalid player character when attempting to remove items in player left game event.
---------------------------------------------------------------------------------------------------
Version: 2.1.3
Date: 2024-10-27
Minor Features:

View File

@ -1,6 +1,6 @@
{
"name": "oarc-mod",
"version": "2.1.3",
"version": "2.1.4",
"factorio_version": "2.0",
"title": "Oarc Multiplayer Spawn",
"author": "Oarcinae",

View File

@ -436,6 +436,7 @@ end
---@param player LuaPlayer
---@return nil
function RemovePlayerStarterItems(player)
if player == nil or player.character == nil then return end
local surface_name = player.character.surface.name
if (storage.ocfg.surfaces_config[surface_name]) ~= nil then
local startItems = storage.ocfg.surfaces_config[surface_name].starting_items.player_start_items