From e7e740dff1f903b40a297e9bfbc108157d3df8c5 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 27 Aug 2023 23:23:17 -0500 Subject: [PATCH] blocked player character specific block in minion training message handler --- .../handlers/MinionTrainingMsgHandler.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/engine/net/client/handlers/MinionTrainingMsgHandler.java b/src/engine/net/client/handlers/MinionTrainingMsgHandler.java index a6aa404e..ba383580 100644 --- a/src/engine/net/client/handlers/MinionTrainingMsgHandler.java +++ b/src/engine/net/client/handlers/MinionTrainingMsgHandler.java @@ -74,16 +74,17 @@ public class MinionTrainingMsgHandler extends AbstractClientMsgHandler { DbManager.removeFromCache(toRemove); + if(toRemove.guardCaptain.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) { + PlayerCharacter petOwner = (PlayerCharacter) toRemove.guardCaptain; - PlayerCharacter petOwner = (PlayerCharacter) toRemove.guardCaptain; - - if (petOwner != null) { - petOwner.setPet(null); + if (petOwner != null) { + petOwner.setPet(null); - toRemove.guardCaptain = null; - PetMsg petMsg = new PetMsg(5, null); - Dispatch dispatch = Dispatch.borrow(petOwner, petMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + toRemove.guardCaptain = null; + PetMsg petMsg = new PetMsg(5, null); + Dispatch dispatch = Dispatch.borrow(petOwner, petMsg); + DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + } } // we Found the move to remove, lets break the for loop so it doesnt look for more.