Browse Source

check for null target when cancelling jobs

combat-3
FatBoy-DOTC 5 months ago
parent
commit
a348056c86
  1. 4
      src/engine/net/client/handlers/AttackCmdMsgHandler.java

4
src/engine/net/client/handlers/AttackCmdMsgHandler.java

@ -87,7 +87,7 @@ public class AttackCmdMsgHandler extends AbstractClientMsgHandler { @@ -87,7 +87,7 @@ public class AttackCmdMsgHandler extends AbstractClientMsgHandler {
//check if we are changing targets, cancel outstanding jobs if so
if (playerCharacter.getTimers().containsKey("Attack" + mbEnums.EquipSlotType.RHELD)) {
AttackJob ajR = ((AttackJob)playerCharacter.getTimers().get("Attack" + mbEnums.EquipSlotType.RHELD).getJob());
if(!ajR.target.equals(target)){
if(ajR.target != null && !ajR.target.equals(target)){
playerCharacter.getTimers().get("Attack" + mbEnums.EquipSlotType.RHELD).cancelJob();
addedDelay = ajR.getStopTime() - System.currentTimeMillis();
}else{
@ -97,7 +97,7 @@ public class AttackCmdMsgHandler extends AbstractClientMsgHandler { @@ -97,7 +97,7 @@ public class AttackCmdMsgHandler extends AbstractClientMsgHandler {
if (playerCharacter.getTimers().containsKey("Attack" + mbEnums.EquipSlotType.LHELD)) {
AttackJob ajL = ((AttackJob)playerCharacter.getTimers().get("Attack" + mbEnums.EquipSlotType.LHELD).getJob());
if(!ajL.target.equals(target)){
if(ajL.target != null && !ajL.target.equals(target)){
playerCharacter.getTimers().get("Attack" + mbEnums.EquipSlotType.LHELD).cancelJob();
addedDelay = ajL.getStopTime() - System.currentTimeMillis();
}else{

Loading…
Cancel
Save