From 07e993b0bac48559a98ec6761b499462ac2be2c2 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Wed, 5 Apr 2023 20:06:28 -0500 Subject: [PATCH] NPC and mob regions for real this time --- src/engine/net/client/msg/LoadCharacterMsg.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/engine/net/client/msg/LoadCharacterMsg.java b/src/engine/net/client/msg/LoadCharacterMsg.java index e88783ad..abe292ad 100644 --- a/src/engine/net/client/msg/LoadCharacterMsg.java +++ b/src/engine/net/client/msg/LoadCharacterMsg.java @@ -86,30 +86,31 @@ public class LoadCharacterMsg extends ClientNetMsg { } else if (absChar != null) { - if (absChar.getObjectType().equals(GameObjectType.PlayerCharacter)){ + if (absChar.getObjectType().equals(GameObjectType.PlayerCharacter)) { Regions region = absChar.getRegion(); - - if (region == null){ + + if (region == null) { writer.putInt(-1); writer.putInt(-1); - }else{ + } else { Building regionBuilding = Regions.GetBuildingForRegion(region); - if (regionBuilding == null){ + if (regionBuilding == null) { writer.putInt(-1); writer.putInt(-1); - }else{ + } else { writer.putInt(region.getLevel()); writer.putInt(region.getRoom()); } } + } else if (absChar.getObjectType().equals(GameObjectType.Mob)){ - Regions Mobregion = absChar.getRegion(); + Regions region = absChar.getRegion(); if (region == null){ writer.putInt(-1); writer.putInt(-1); }else{ - Building regionBuilding = Regions.GetBuildingForRegion(Mobregion); + Building regionBuilding = Regions.GetBuildingForRegion(region); if (regionBuilding == null){ writer.putInt(-1); writer.putInt(-1);