Location serialization matches NPC

This commit is contained in:
2023-04-30 10:20:21 -04:00
parent 1ab8540f73
commit b5e2848091
+11 -4
View File
@@ -391,12 +391,20 @@ public class Mob extends AbstractIntelligenceAgent {
writer.putInt(2); //Unknown writer.putInt(2); //Unknown
writer.putInt(1); //Unknown - Headlights? writer.putInt(1); //Unknown - Headlights?
writer.putInt(0); writer.putInt(0);
writer.putInt(0);
writer.putInt(0); if (mob.building != null && mob.region != null) {
writer.putInt(mob.building.getObjectType().ordinal());
writer.putInt(mob.building.getObjectUUID());
} else {
writer.putInt(0); //<-Building Object Type
writer.putInt(0); //<-Building Object ID
}
writer.put((byte) 0); writer.put((byte) 0);
writer.put((byte) 0); writer.put((byte) 0);
writer.put((byte) 0); writer.put((byte) 0);
writer.putInt(0);
writer.putInt(0); // NPC menu options
if (mob.contract != null && mob.npcOwner == null) { if (mob.contract != null && mob.npcOwner == null) {
writer.put((byte) 1); writer.put((byte) 1);
@@ -408,7 +416,6 @@ public class Mob extends AbstractIntelligenceAgent {
} else writer.put((byte) 0); } else writer.put((byte) 0);
if (mob.npcOwner != null) { if (mob.npcOwner != null) {
writer.put((byte) 1); writer.put((byte) 1);
writer.putInt(GameObjectType.PlayerCharacter.ordinal()); writer.putInt(GameObjectType.PlayerCharacter.ordinal());