Prevent auto targeting dead creatures.

This commit is contained in:
MobiusDevelopment 2021-10-12 21:14:22 +00:00
parent 8080df1274
commit 19fa9a724e
6 changed files with 12 additions and 6 deletions

View File

@ -30,6 +30,7 @@ import org.l2jmobius.gameserver.handler.ItemHandler;
import org.l2jmobius.gameserver.handler.PlayerActionHandler;
import org.l2jmobius.gameserver.model.ActionDataHolder;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.Playable;
import org.l2jmobius.gameserver.model.actor.Summon;
import org.l2jmobius.gameserver.model.actor.instance.GuardInstance;
@ -246,7 +247,7 @@ public class AutoUseTaskManager implements Runnable
}
// Check bad skill target.
if ((target == null) || !target.isAttackable())
if ((target == null) || !target.isAttackable() || ((Creature) target).isDead())
{
break SKILLS;
}

View File

@ -30,6 +30,7 @@ import org.l2jmobius.gameserver.handler.ItemHandler;
import org.l2jmobius.gameserver.handler.PlayerActionHandler;
import org.l2jmobius.gameserver.model.ActionDataHolder;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.Playable;
import org.l2jmobius.gameserver.model.actor.Summon;
import org.l2jmobius.gameserver.model.actor.instance.GuardInstance;
@ -246,7 +247,7 @@ public class AutoUseTaskManager implements Runnable
}
// Check bad skill target.
if ((target == null) || !target.isAttackable())
if ((target == null) || !target.isAttackable() || ((Creature) target).isDead())
{
break SKILLS;
}

View File

@ -30,6 +30,7 @@ import org.l2jmobius.gameserver.handler.ItemHandler;
import org.l2jmobius.gameserver.handler.PlayerActionHandler;
import org.l2jmobius.gameserver.model.ActionDataHolder;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.Playable;
import org.l2jmobius.gameserver.model.actor.Summon;
import org.l2jmobius.gameserver.model.actor.instance.GuardInstance;
@ -246,7 +247,7 @@ public class AutoUseTaskManager implements Runnable
}
// Check bad skill target.
if ((target == null) || !target.isAttackable())
if ((target == null) || !target.isAttackable() || ((Creature) target).isDead())
{
break SKILLS;
}

View File

@ -30,6 +30,7 @@ import org.l2jmobius.gameserver.handler.ItemHandler;
import org.l2jmobius.gameserver.handler.PlayerActionHandler;
import org.l2jmobius.gameserver.model.ActionDataHolder;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.Playable;
import org.l2jmobius.gameserver.model.actor.Summon;
import org.l2jmobius.gameserver.model.actor.instance.GuardInstance;
@ -246,7 +247,7 @@ public class AutoUseTaskManager implements Runnable
}
// Check bad skill target.
if ((target == null) || !target.isAttackable())
if ((target == null) || !target.isAttackable() || ((Creature) target).isDead())
{
break SKILLS;
}

View File

@ -30,6 +30,7 @@ import org.l2jmobius.gameserver.handler.ItemHandler;
import org.l2jmobius.gameserver.handler.PlayerActionHandler;
import org.l2jmobius.gameserver.model.ActionDataHolder;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.Playable;
import org.l2jmobius.gameserver.model.actor.Summon;
import org.l2jmobius.gameserver.model.actor.instance.GuardInstance;
@ -246,7 +247,7 @@ public class AutoUseTaskManager implements Runnable
}
// Check bad skill target.
if ((target == null) || !target.isAttackable())
if ((target == null) || !target.isAttackable() || ((Creature) target).isDead())
{
break SKILLS;
}

View File

@ -30,6 +30,7 @@ import org.l2jmobius.gameserver.handler.ItemHandler;
import org.l2jmobius.gameserver.handler.PlayerActionHandler;
import org.l2jmobius.gameserver.model.ActionDataHolder;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.Playable;
import org.l2jmobius.gameserver.model.actor.Summon;
import org.l2jmobius.gameserver.model.actor.instance.GuardInstance;
@ -246,7 +247,7 @@ public class AutoUseTaskManager implements Runnable
}
// Check bad skill target.
if ((target == null) || !target.isAttackable())
if ((target == null) || !target.isAttackable() || ((Creature) target).isDead())
{
break SKILLS;
}