From 5d897c5b50e92f21266aa137e91dbeee398b0468 Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Wed, 21 Apr 2021 11:07:07 +0000 Subject: [PATCH] Fixed onMagicFinalizer null target NPE. --- .../java/org/l2jmobius/gameserver/model/actor/Creature.java | 2 +- .../java/org/l2jmobius/gameserver/model/actor/Creature.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/Creature.java index 782d61dde3..2b47dbf1a2 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -7439,7 +7439,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder // if the skill has changed the character's state to something other than STATE_CASTING // then just leave it that way, otherwise switch back to STATE_IDLE. - if ((skill.getId() != 345) && (skill.getId() != 346) && _target.canBeAttacked()) + if ((skill.getId() != 345) && (skill.getId() != 346) && (_target != null) && _target.canBeAttacked()) { // Like L2OFF while use a skill and next intention == null the char stop auto attack if (((getAI().getNextIntention() == null) && ((skill.getSkillType() == SkillType.PDAM) && (skill.getCastRange() < 400))) || (skill.getSkillType() == SkillType.BLOW) || (skill.getSkillType() == SkillType.DRAIN_SOUL) || (skill.getSkillType() == SkillType.SOW) || (skill.getSkillType() == SkillType.SPOIL)) diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java index 187ccfa7a5..822ce41b7c 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -7486,7 +7486,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder // if the skill has changed the character's state to something other than STATE_CASTING // then just leave it that way, otherwise switch back to STATE_IDLE. - if ((skill.getId() != 345) && (skill.getId() != 346) && _target.canBeAttacked()) + if ((skill.getId() != 345) && (skill.getId() != 346) && (_target != null) && _target.canBeAttacked()) { // Like L2OFF while use a skill and next intention == null the char stop auto attack if (((getAI().getNextIntention() == null) && ((skill.getSkillType() == SkillType.PDAM) && (skill.getCastRange() < 400))) || (skill.getSkillType() == SkillType.BLOW) || (skill.getSkillType() == SkillType.DRAIN_SOUL) || (skill.getSkillType() == SkillType.SOW) || (skill.getSkillType() == SkillType.SPOIL))