Replaced instanceof L2Character with isCharacter method.
This commit is contained in:
@@ -605,7 +605,7 @@ public abstract class AbstractAI implements Ctrl
|
||||
}
|
||||
|
||||
// Send a Server->Client packet MoveToPawn/CharMoveToLocation to the actor and all L2PcInstance in its _knownPlayers
|
||||
if (pawn instanceof L2Character)
|
||||
if (pawn.isCharacter())
|
||||
{
|
||||
if (_actor.isOnGeodataPath())
|
||||
{
|
||||
|
@@ -2070,7 +2070,7 @@ public class L2AttackableAI extends L2CharacterAI
|
||||
{
|
||||
continue;
|
||||
}
|
||||
final L2Character obj = target instanceof L2Character ? (L2Character) target : null;
|
||||
final L2Character obj = target.isCharacter() ? (L2Character) target : null;
|
||||
if ((obj == null) || !GeoEngine.getInstance().canSeeTarget(actor, obj) || (dist2 > range))
|
||||
{
|
||||
continue;
|
||||
|
@@ -477,7 +477,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();
|
||||
}
|
||||
|
@@ -128,7 +128,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;
|
||||
}
|
||||
|
@@ -5286,7 +5286,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
final List<L2Object> targetList = new ArrayList<>();
|
||||
for (L2Object target : targets)
|
||||
{
|
||||
if (target instanceof L2Character)
|
||||
if (target.isCharacter())
|
||||
{
|
||||
if (!isInsideRadius(target.getX(), target.getY(), target.getZ(), escapeRange + _template.getCollisionRadius(), true, false))
|
||||
{
|
||||
@@ -5535,7 +5535,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
|
||||
// Attack target after skill use
|
||||
if ((skill.nextActionIsAttack()) && (_target instanceof L2Character) && (_target != this) && (target != null) && (_target == target) && target.canBeAttacked())
|
||||
if ((skill.nextActionIsAttack()) && _target.isCharacter() && (_target != this) && (target != null) && (_target == target) && target.canBeAttacked())
|
||||
{
|
||||
if ((getAI().getNextIntention() == null) || (getAI().getNextIntention().getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO))
|
||||
{
|
||||
@@ -5845,7 +5845,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
return false;
|
||||
}
|
||||
|
||||
if (target instanceof L2Character)
|
||||
if (target.isCharacter())
|
||||
{
|
||||
final L2Character target1 = (L2Character) target;
|
||||
angleChar = Util.calculateAngleFrom(this, target1);
|
||||
@@ -5929,7 +5929,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
public boolean isInFrontOfTarget()
|
||||
{
|
||||
final L2Object target = _target;
|
||||
if (target instanceof L2Character)
|
||||
if (target.isCharacter())
|
||||
{
|
||||
return isInFrontOf((L2Character) target);
|
||||
}
|
||||
|
@@ -4736,7 +4736,7 @@ public final class L2PcInstance extends L2Playable
|
||||
oldTarget.removeStatusListener(this);
|
||||
}
|
||||
|
||||
if (newTarget instanceof L2Character)
|
||||
if ((newTarget != null) && newTarget.isCharacter())
|
||||
{
|
||||
final L2Character target = (L2Character) newTarget;
|
||||
|
||||
|
@@ -820,7 +820,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)
|
||||
|
@@ -1020,7 +1020,7 @@ public final class Skill implements IIdentifiable
|
||||
return true;
|
||||
}
|
||||
|
||||
final L2Character target = (object instanceof L2Character) ? (L2Character) object : null;
|
||||
final L2Character target = object.isCharacter() ? (L2Character) object : null;
|
||||
for (Condition cond : preCondition)
|
||||
{
|
||||
if (!cond.test(activeChar, target, this))
|
||||
@@ -1064,7 +1064,7 @@ public final class Skill implements IIdentifiable
|
||||
// Get the L2Objcet targeted by the user of the skill at this moment
|
||||
final L2Object objTarget = activeChar.getTarget();
|
||||
// If the L2Object targeted is a L2Character, it becomes the L2Character target
|
||||
if (objTarget instanceof L2Character)
|
||||
if ((objTarget != null) && objTarget.isCharacter())
|
||||
{
|
||||
target = (L2Character) objTarget;
|
||||
}
|
||||
|
@@ -58,7 +58,7 @@ public class RequestRecordInfo implements IClientIncomingPacket
|
||||
{
|
||||
object.sendInfo(activeChar);
|
||||
|
||||
if (object instanceof L2Character)
|
||||
if (object.isCharacter())
|
||||
{
|
||||
// Update the state of the L2Character object client
|
||||
// side by sending Server->Client packet
|
||||
|
@@ -201,11 +201,11 @@ public final class Util
|
||||
}
|
||||
|
||||
int radius = 0;
|
||||
if (obj1 instanceof L2Character)
|
||||
if (obj1.isCharacter())
|
||||
{
|
||||
radius += ((L2Character) obj1).getTemplate().getCollisionRadius();
|
||||
}
|
||||
if (obj2 instanceof L2Character)
|
||||
if (obj2.isCharacter())
|
||||
{
|
||||
radius += ((L2Character) obj2).getTemplate().getCollisionRadius();
|
||||
}
|
||||
|
@@ -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