From 6ac1911770d34f3c32b201f34c23595406645fc6 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Wed, 22 Feb 2023 08:38:18 -0500 Subject: [PATCH] Code cleanup; reworked conditional. --- src/engine/net/client/handlers/CityDataHandler.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/engine/net/client/handlers/CityDataHandler.java b/src/engine/net/client/handlers/CityDataHandler.java index 3706d798..1b304b30 100644 --- a/src/engine/net/client/handlers/CityDataHandler.java +++ b/src/engine/net/client/handlers/CityDataHandler.java @@ -36,6 +36,7 @@ public class CityDataHandler extends AbstractClientMsgHandler { Session playerSession; PlayerCharacter playerCharacter; Zone hotZone; + Dispatch dispatch; playerCharacter = origin.getPlayerCharacter(); @@ -70,17 +71,16 @@ public class CityDataHandler extends AbstractClientMsgHandler { cityDataMsg.updateMines(updateMine); cityDataMsg.updateCities(updateCity); - Dispatch dispatch = Dispatch.borrow(playerCharacter, cityDataMsg); + dispatch = Dispatch.borrow(playerCharacter, cityDataMsg); DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); - if (playerCharacter.getTimeStamp("hotzoneupdate") <= WorldServer.getLastHZChange()) { + // If the hotZone has changed then update the client's map accordingly. - if (hotZone != null) { + if (playerCharacter.getTimeStamp("hotzoneupdate") <= WorldServer.getLastHZChange() && hotZone != null) { HotzoneChangeMsg hotzoneChangeMsg = new HotzoneChangeMsg(Enum.GameObjectType.Zone.ordinal(), hotZone.getObjectUUID()); dispatch = Dispatch.borrow(playerCharacter, hotzoneChangeMsg); DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); playerCharacter.setTimeStamp("hotzoneupdate", System.currentTimeMillis() - 100); - } } // Serialize the realms for this map