From 21241aa5dff135ac101e83e4483112ad8cf42b66 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 30 Apr 2023 08:02:28 -0400 Subject: [PATCH] One serialization not 3. --- src/engine/net/client/msg/LoadCharacterMsg.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/engine/net/client/msg/LoadCharacterMsg.java b/src/engine/net/client/msg/LoadCharacterMsg.java index f94cf6c9..8ba8a111 100644 --- a/src/engine/net/client/msg/LoadCharacterMsg.java +++ b/src/engine/net/client/msg/LoadCharacterMsg.java @@ -17,7 +17,6 @@ import engine.net.ByteBufferWriter; import engine.net.client.Protocol; import engine.objects.AbstractCharacter; import engine.objects.Corpse; -import engine.objects.NPC; public class LoadCharacterMsg extends ClientNetMsg { @@ -71,11 +70,10 @@ public class LoadCharacterMsg extends ClientNetMsg { protected void _serialize(ByteBufferWriter writer) throws SerializationException { if (absChar != null) { - NPC npc = (NPC) absChar; - if (npc.region != null) { - writer.putInt(npc.region.getLevel()); - writer.putInt(npc.region.getRoom()); + if (absChar.region != null) { + writer.putInt(absChar.region.getLevel()); + writer.putInt(absChar.region.getRoom()); } else { writer.putInt(-1); writer.putInt(-1);