From ca29031d7fcdd9c2f5c18a35e1b7dff5452c3796 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Wed, 28 Oct 2026 00:24:26 -0400 Subject: [PATCH] Send parent buildings before their furniture in LOADSTRUCTURE The structure list comes from a HashSet, so its order was never fixed: positive UIDs happened to put a parent before its children, negative static IDs put the children first. Live recordings send the parent first in all 2,365 parent/child pairs within one record (none the other way); the citadel-test recording had all 616 children first, and the Citadel of War's upper-floor table and chairs (CZONE Y 27, sent correctly) showed on the ground floor. Top-level buildings are now written first, then children. Value changes: record order only; every field is unchanged. Co-Authored-By: Claude Opus 5.5 --- src/engine/net/client/msg/LoadStructureMsg.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/engine/net/client/msg/LoadStructureMsg.java b/src/engine/net/client/msg/LoadStructureMsg.java index 9e53dba0..cd15ad44 100644 --- a/src/engine/net/client/msg/LoadStructureMsg.java +++ b/src/engine/net/client/msg/LoadStructureMsg.java @@ -66,9 +66,16 @@ public class LoadStructureMsg extends ClientNetMsg { writer.putInt(this.structureList.size()); - for (Building building : this.structureList) { - Building._serializeForClientMsg(building, writer); - } + // Parents before children, as live servers sent them; a child sent first loses its height on the client. + + for (Building building : this.structureList) + if (building.parentBuildingID == 0) + Building._serializeForClientMsg(building, writer); + + for (Building building : this.structureList) + if (building.parentBuildingID != 0) + Building._serializeForClientMsg(building, writer); + writer.putInt(0); }