diff --git a/plugins/player_sync/module/serialize.lua b/plugins/player_sync/module/serialize.lua index 7cca8e0e..639f9bed 100644 --- a/plugins/player_sync/module/serialize.lua +++ b/plugins/player_sync/module/serialize.lua @@ -196,8 +196,13 @@ function serialize.deserialize_personal_logistic_slots(player, serialized) sec.active = section.active sec.multiplier = section.multiplier if section.group ~= "" then -- "" is the default group name, which is truthy - -- Named groups get added with name only - this avoids overwriting existing groups on the server + -- Named groups that have filters on the server get added with name only - this avoids + -- overwriting existing groups. Missing or empty groups get the filters of the player. + local existing = force.get_logistic_group(section.group) sec.group = section.group + if not existing or #existing.filters == 0 then + sec.filters = section.filters + end else -- Unnamed groups get added with filters sec.filters = section.filters @@ -803,6 +808,8 @@ function serialize.deserialize_player(player, serialized) elseif serialized.controller == "ghost" then -- Ghost state stores hidden logistic and filters which are only accessible in the character controller + -- The force first, so the character and the logistic groups are on the restored player's force + player.force = serialized.force local character = ensure_character(player) if serialized.personal_logistic_slots then serialize.deserialize_personal_logistic_slots(player, serialized.personal_logistic_slots)