forked from MagicBane/Server
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 <noreply@anthropic.com>
This commit is contained in:
1 parent
4c2648046b
commit
ca29031d7f
1 file changed
+10
-3
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user