From 8acfff7faa4b4694b5bcd8704b0e5bdf006144db Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 10 Sep 2023 13:26:28 -0500 Subject: [PATCH] null check for target --- src/engine/net/client/handlers/AttackCmdMsgHandler.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/engine/net/client/handlers/AttackCmdMsgHandler.java b/src/engine/net/client/handlers/AttackCmdMsgHandler.java index c4c4952a..3c137631 100644 --- a/src/engine/net/client/handlers/AttackCmdMsgHandler.java +++ b/src/engine/net/client/handlers/AttackCmdMsgHandler.java @@ -63,6 +63,10 @@ public class AttackCmdMsgHandler extends AbstractClientMsgHandler { return true; //cannot attack other things } + if(target == null) { + playerCharacter.setCombatTarget(target); + return true; // cannot attack a null target + } //set sources target playerCharacter.setCombatTarget(target);