Fix crash loading mutiplayer map in singleplayer

Caused by on_player_created not being called when
loading a multiplayer map in singleplayer. For
further discussion see $622 and
https://forums.factorio.com/viewtopic.php?f=7&t=113497
This commit is contained in:
Danielv123 authored and Daniel committed 2024-05-18 10:59:19 +02:00
1 parent d7c2e7eed7
commit c8e54cd563
1 file changed
+7 -1
@@ -357,8 +357,14 @@ end
-- Download inventory from controller
inventory_sync.events[defines.events.on_player_joined_game] = function(event)
-- Send acquire request even if an active download is currently in plogress
local player = game.get_player(event.player_index)
-- It's possible Factorio doesn't invoke the on_player_created event when loading a save in single player
if not global.inventory_sync.players[player.name] then
create_player(player, false)
end
-- Send acquire request even if an active download is currently in plogress
inventory_sync.acquire(player, false)
-- Clear active upload if it existsi