Replaced instanceof L2Playable with isPlayable method.

This commit is contained in:
MobiusDev
2018-07-02 00:39:38 +00:00
parent e7ac53ba66
commit 6c1d37f4ae
46 changed files with 62 additions and 79 deletions

View File

@ -41,7 +41,7 @@ public abstract class L2PlayableAI extends L2CharacterAI
@Override
protected void onIntentionAttack(L2Character target)
{
if (target instanceof L2Playable)
if ((target != null) && target.isPlayable())
{
if (target.getActingPlayer().isProtectionBlessingAffected() && ((_actor.getActingPlayer().getLevel() - target.getActingPlayer().getLevel()) >= 10) && (_actor.getActingPlayer().getReputation() < 0) && !(target.isInsideZone(ZoneId.PVP)))
{

View File

@ -24,7 +24,6 @@ import com.l2jmobius.gameserver.instancemanager.FortManager;
import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.L2Attackable;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.L2Playable;
import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
import com.l2jmobius.gameserver.model.entity.Castle;
import com.l2jmobius.gameserver.model.entity.Fort;
@ -60,7 +59,7 @@ public class L2DefenderInstance extends L2Attackable
public boolean isAutoAttackable(L2Character attacker)
{
// Attackable during siege by all except defenders
if (!(attacker instanceof L2Playable))
if (!attacker.isPlayable())
{
return false;
}

View File

@ -17,7 +17,6 @@
package com.l2jmobius.gameserver.model.conditions;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.L2Playable;
import com.l2jmobius.gameserver.model.items.L2Item;
import com.l2jmobius.gameserver.model.skills.Skill;
@ -29,6 +28,6 @@ public class ConditionTargetPlayable extends Condition
@Override
public boolean testImpl(L2Character effector, L2Character effected, Skill skill, L2Item item)
{
return effected instanceof L2Playable;
return (effected != null) && effected.isPlayable();
}
}