Keep quick bar slots whose record is not in the blueprint library yet

A save gets a player's blueprint library from the client some seconds
after the join. The data of a player new to the save is applied before
that, so quick bar slots pointing at library records were cleared, and
the next upload stored the quick bar without them.

The entries are now kept. They are set once the record shows up, and an
upload before that stores them again as they came.

Fixes #1219

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JyNnVzRW4jPWaoWTxCyhM7
This commit is contained in:
ILLISISandClaude Fable 5.2 committed 2026-11-14 13:24:10 +11:00
1 parent 635b10a3dc
commit 0b0e2fd377
2 files changed
+90 -15

No files matched your search

@@ -634,6 +634,7 @@ player_sync.on_nth_tick[33] = function(event)
player_sync.check_players_in_cutscene()
player_sync.check_active_downloads()
player_sync.check_active_uploads()
player_sync.check_missing_quick_bar_records()
end
player_sync.events[defines.events.on_cutscene_waypoint_reached] = function(event)
@@ -781,6 +782,20 @@ function player_sync.check_active_downloads()
end
end
-- Quick bar slots pointing into the blueprint library are set once the save has the player's library
function player_sync.check_missing_quick_bar_records()
local script_data = get_script_data()
for player_name, failed in pairs(script_data.failed_deserialization) do
local player = failed.quick_bar and game.get_player(player_name)
if player and player.connected then
failed.quick_bar = serialize.restore_missing_quick_bar_records(player, failed.quick_bar)
if not next(failed) then
script_data.failed_deserialization[player_name] = nil
end
end
end
end
function player_sync.check_active_uploads()
local script_data = get_script_data()
for player_name, record in pairs(script_data.active_uploads) do