Replaced instanceof L2Attackable with isAttackable method.
This commit is contained in:
@@ -88,7 +88,7 @@ public final class L2WorldRegion
|
||||
{
|
||||
for (L2Object o : _visibleObjects.values())
|
||||
{
|
||||
if (o instanceof L2Attackable)
|
||||
if (o.isAttackable())
|
||||
{
|
||||
c++;
|
||||
final L2Attackable mob = (L2Attackable) o;
|
||||
@@ -123,7 +123,7 @@ public final class L2WorldRegion
|
||||
{
|
||||
for (L2Object o : _visibleObjects.values())
|
||||
{
|
||||
if (o instanceof L2Attackable)
|
||||
if (o.isAttackable())
|
||||
{
|
||||
c++;
|
||||
// Start HP/MP/CP Regeneration task
|
||||
|
@@ -58,7 +58,7 @@ public class ConditionPlayerCanSweep extends Condition
|
||||
{
|
||||
skill.forEachTargetAffected(sweeper, effected, o ->
|
||||
{
|
||||
if (o instanceof L2Attackable)
|
||||
if ((o != null) && o.isAttackable())
|
||||
{
|
||||
final L2Attackable target = (L2Attackable) o;
|
||||
if (target.isDead())
|
||||
|
@@ -3206,7 +3206,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
||||
*/
|
||||
protected void addAttackPlayerDesire(L2Npc npc, L2Playable target, int desire)
|
||||
{
|
||||
if (npc instanceof L2Attackable)
|
||||
if (npc.isAttackable())
|
||||
{
|
||||
((L2Attackable) npc).addDamageHate(target, 0, desire);
|
||||
}
|
||||
|
Reference in New Issue
Block a user