Replaced instanceof L2Character with isCharacter method.
This commit is contained in:
@ -700,7 +700,7 @@ public abstract class AbstractAI implements Ctrl
|
||||
|
||||
public boolean isFollowing()
|
||||
{
|
||||
return (_target instanceof L2Character) && (_intention == AI_INTENTION_FOLLOW);
|
||||
return (_target != null) && _target.isCharacter() && (_intention == AI_INTENTION_FOLLOW);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -487,7 +487,7 @@ public class GeoEngine
|
||||
|
||||
// get origin and target height, real height = collision height * 2
|
||||
double oheight = 0;
|
||||
if (origin instanceof L2Character)
|
||||
if (origin.isCharacter())
|
||||
{
|
||||
oheight = ((L2Character) origin).getTemplate().getCollisionHeight();
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ public final class ZoneManager implements IGameXmlReader
|
||||
// Re-validate all characters in zones
|
||||
for (L2Object obj : L2World.getInstance().getVisibleObjects())
|
||||
{
|
||||
if (obj instanceof L2Character)
|
||||
if (obj.isCharacter())
|
||||
{
|
||||
((L2Character) obj).revalidateZone(true);
|
||||
}
|
||||
|
@ -194,7 +194,7 @@ public class L2CommandChannel extends AbstractPlayerGroup
|
||||
*/
|
||||
public boolean meetRaidWarCondition(L2Object obj)
|
||||
{
|
||||
if (!((obj instanceof L2Character) && ((L2Character) obj).isRaid()))
|
||||
if (!(obj.isCharacter() && ((L2Character) obj).isRaid()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -4676,7 +4676,7 @@ public final class L2PcInstance extends L2Playable
|
||||
oldTarget.removeStatusListener(this);
|
||||
}
|
||||
|
||||
if (newTarget instanceof L2Character)
|
||||
if ((newTarget != null) && newTarget.isCharacter())
|
||||
{
|
||||
final L2Character target = (L2Character) newTarget;
|
||||
|
||||
|
@ -800,7 +800,7 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
|
||||
return true;
|
||||
}
|
||||
|
||||
final L2Character target = (object instanceof L2Character) ? (L2Character) object : null;
|
||||
final L2Character target = object.isCharacter() ? (L2Character) object : null;
|
||||
for (Condition preCondition : _preConditions)
|
||||
{
|
||||
if (preCondition == null)
|
||||
|
@ -588,7 +588,7 @@ public class SkillCaster implements Runnable
|
||||
{
|
||||
for (L2Object obj : targets)
|
||||
{
|
||||
if (!(obj instanceof L2Character))
|
||||
if (!obj.isCharacter())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ public class DamageFormatter extends Formatter
|
||||
|
||||
if (p instanceof L2Character)
|
||||
{
|
||||
if ((p instanceof L2Character) && ((L2Character) p).isRaid())
|
||||
if (((L2Character) p).isRaid())
|
||||
{
|
||||
StringUtil.append(output, "RaidBoss ");
|
||||
}
|
||||
|
Reference in New Issue
Block a user