Replaced instanceof L2MonsterInstance with isMonster method.

This commit is contained in:
MobiusDev
2018-07-02 01:32:38 +00:00
parent 5f62a4c740
commit bd285c1368
16 changed files with 74 additions and 58 deletions

View File

@@ -42,13 +42,16 @@ public class ConditionTargetAggro extends Condition
@Override
public boolean testImpl(L2Character effector, L2Character effected, Skill skill, L2Item item)
{
if (effected instanceof L2MonsterInstance)
if (effected != null)
{
return ((L2MonsterInstance) effected).isAggressive() == _isAggro;
}
if (effected.isPlayer())
{
return ((L2PcInstance) effected).getReputation() < 0;
if (effected.isMonster())
{
return ((L2MonsterInstance) effected).isAggressive() == _isAggro;
}
if (effected.isPlayer())
{
return ((L2PcInstance) effected).getReputation() < 0;
}
}
return false;
}