From a75354f9bbda447a27ec18737d4e1d7449d1dfac Mon Sep 17 00:00:00 2001 From: ILLISIS <92364928+ILLISIS@users.noreply.github.com> Date: Fri, 16 Oct 2026 23:29:37 +1100 Subject: [PATCH] Restore logistic group filters when the group is missing or empty (#1097) * Restore logistic group filters when the group is missing or empty Named personal logistic groups were restored by name only, so a force without a group of that name got an empty one, and the empty filters were uploaded again on leave. Keep assigning the name only when the force's group already has filters, otherwise also write the stored filters. Co-Authored-By: Claude Opus 5.5 (1M context) * Restore ghost player force before logistic slots A player waiting to respawn had its personal logistic slots restored before its force was set. The group lookup and the filter write then used the force the player had on this server, which could write the incoming requests into a group shared with other players. Co-Authored-By: Claude Opus 5.5 (1M context) --------- Co-authored-by: ILLISIS Co-authored-by: Claude Opus 5.5 (1M context) --- plugins/player_sync/module/serialize.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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)