AdminKill handler null target fix.

Contributed by CostyKiller.
This commit is contained in:
MobiusDevelopment 2022-01-14 07:00:51 +00:00
parent b77aed5b99
commit 1df749fff3
23 changed files with 23 additions and 23 deletions

View File

@ -108,7 +108,7 @@ public class AdminKill implements IAdminCommandHandler
else else
{ {
final WorldObject obj = activeChar.getTarget(); final WorldObject obj = activeChar.getTarget();
if ((obj instanceof ControllableMob) || !obj.isCreature()) if ((obj == null) || (obj instanceof ControllableMob) || !obj.isCreature())
{ {
activeChar.sendPacket(SystemMessageId.INVALID_TARGET); activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
} }

View File

@ -108,7 +108,7 @@ public class AdminKill implements IAdminCommandHandler
else else
{ {
final WorldObject obj = activeChar.getTarget(); final WorldObject obj = activeChar.getTarget();
if ((obj instanceof ControllableMob) || !obj.isCreature()) if ((obj == null) || (obj instanceof ControllableMob) || !obj.isCreature())
{ {
activeChar.sendPacket(SystemMessageId.INVALID_TARGET); activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
} }

View File

@ -108,7 +108,7 @@ public class AdminKill implements IAdminCommandHandler
else else
{ {
final WorldObject obj = activeChar.getTarget(); final WorldObject obj = activeChar.getTarget();
if ((obj instanceof ControllableMob) || !obj.isCreature()) if ((obj == null) || (obj instanceof ControllableMob) || !obj.isCreature())
{ {
activeChar.sendPacket(SystemMessageId.INVALID_TARGET); activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
} }

View File

@ -108,7 +108,7 @@ public class AdminKill implements IAdminCommandHandler
else else
{ {
final WorldObject obj = activeChar.getTarget(); final WorldObject obj = activeChar.getTarget();
if ((obj instanceof ControllableMob) || !obj.isCreature()) if ((obj == null) || (obj instanceof ControllableMob) || !obj.isCreature())
{ {
activeChar.sendPacket(SystemMessageId.INVALID_TARGET); activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
} }

View File

@ -108,7 +108,7 @@ public class AdminKill implements IAdminCommandHandler
else else
{ {
final WorldObject obj = activeChar.getTarget(); final WorldObject obj = activeChar.getTarget();
if ((obj instanceof ControllableMob) || !obj.isCreature()) if ((obj == null) || (obj instanceof ControllableMob) || !obj.isCreature())
{ {
activeChar.sendPacket(SystemMessageId.INVALID_TARGET); activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
} }

View File

@ -108,7 +108,7 @@ public class AdminKill implements IAdminCommandHandler
else else
{ {
final WorldObject obj = activeChar.getTarget(); final WorldObject obj = activeChar.getTarget();
if ((obj instanceof ControllableMob) || !obj.isCreature()) if ((obj == null) || (obj instanceof ControllableMob) || !obj.isCreature())
{ {
activeChar.sendPacket(SystemMessageId.INVALID_TARGET); activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
} }

View File

@ -108,7 +108,7 @@ public class AdminKill implements IAdminCommandHandler
else else
{ {
final WorldObject obj = activeChar.getTarget(); final WorldObject obj = activeChar.getTarget();
if ((obj instanceof ControllableMob) || !obj.isCreature()) if ((obj == null) || (obj instanceof ControllableMob) || !obj.isCreature())
{ {
activeChar.sendPacket(SystemMessageId.INVALID_TARGET); activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
} }

View File

@ -108,7 +108,7 @@ public class AdminKill implements IAdminCommandHandler
else else
{ {
final WorldObject obj = activeChar.getTarget(); final WorldObject obj = activeChar.getTarget();
if ((obj instanceof ControllableMob) || !obj.isCreature()) if ((obj == null) || (obj instanceof ControllableMob) || !obj.isCreature())
{ {
activeChar.sendPacket(SystemMessageId.INVALID_TARGET); activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
} }

View File

@ -108,7 +108,7 @@ public class AdminKill implements IAdminCommandHandler
else else
{ {
final WorldObject obj = activeChar.getTarget(); final WorldObject obj = activeChar.getTarget();
if ((obj instanceof ControllableMob) || !obj.isCreature()) if ((obj == null) || (obj instanceof ControllableMob) || !obj.isCreature())
{ {
activeChar.sendPacket(SystemMessageId.INVALID_TARGET); activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
} }

View File

@ -108,7 +108,7 @@ public class AdminKill implements IAdminCommandHandler
else else
{ {
final WorldObject obj = activeChar.getTarget(); final WorldObject obj = activeChar.getTarget();
if ((obj instanceof ControllableMob) || !obj.isCreature()) if ((obj == null) || (obj instanceof ControllableMob) || !obj.isCreature())
{ {
activeChar.sendPacket(SystemMessageId.INVALID_TARGET); activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
} }

View File

@ -108,7 +108,7 @@ public class AdminKill implements IAdminCommandHandler
else else
{ {
final WorldObject obj = activeChar.getTarget(); final WorldObject obj = activeChar.getTarget();
if ((obj instanceof ControllableMob) || !obj.isCreature()) if ((obj == null) || (obj instanceof ControllableMob) || !obj.isCreature())
{ {
activeChar.sendPacket(SystemMessageId.INVALID_TARGET); activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
} }

View File

@ -107,7 +107,7 @@ public class AdminKill implements IAdminCommandHandler
else else
{ {
final WorldObject obj = activeChar.getTarget(); final WorldObject obj = activeChar.getTarget();
if ((obj instanceof ControllableMob) || !obj.isCreature()) if ((obj == null) || (obj instanceof ControllableMob) || !obj.isCreature())
{ {
activeChar.sendPacket(SystemMessageId.INVALID_TARGET); activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
} }

View File

@ -107,7 +107,7 @@ public class AdminKill implements IAdminCommandHandler
else else
{ {
final WorldObject obj = activeChar.getTarget(); final WorldObject obj = activeChar.getTarget();
if ((obj instanceof ControllableMob) || !obj.isCreature()) if ((obj == null) || (obj instanceof ControllableMob) || !obj.isCreature())
{ {
activeChar.sendPacket(SystemMessageId.INVALID_TARGET); activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
} }

View File

@ -108,7 +108,7 @@ public class AdminKill implements IAdminCommandHandler
else else
{ {
final WorldObject obj = activeChar.getTarget(); final WorldObject obj = activeChar.getTarget();
if ((obj instanceof ControllableMob) || !obj.isCreature()) if ((obj == null) || (obj instanceof ControllableMob) || !obj.isCreature())
{ {
activeChar.sendPacket(SystemMessageId.INVALID_TARGET); activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
} }

View File

@ -108,7 +108,7 @@ public class AdminKill implements IAdminCommandHandler
else else
{ {
final WorldObject obj = activeChar.getTarget(); final WorldObject obj = activeChar.getTarget();
if ((obj instanceof ControllableMob) || !obj.isCreature()) if ((obj == null) || (obj instanceof ControllableMob) || !obj.isCreature())
{ {
activeChar.sendPacket(SystemMessageId.INVALID_TARGET); activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
} }

View File

@ -108,7 +108,7 @@ public class AdminKill implements IAdminCommandHandler
else else
{ {
final WorldObject obj = activeChar.getTarget(); final WorldObject obj = activeChar.getTarget();
if ((obj instanceof ControllableMob) || !obj.isCreature()) if ((obj == null) || (obj instanceof ControllableMob) || !obj.isCreature())
{ {
activeChar.sendPacket(SystemMessageId.INVALID_TARGET); activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
} }

View File

@ -108,7 +108,7 @@ public class AdminKill implements IAdminCommandHandler
else else
{ {
final WorldObject obj = activeChar.getTarget(); final WorldObject obj = activeChar.getTarget();
if ((obj instanceof ControllableMob) || !obj.isCreature()) if ((obj == null) || (obj instanceof ControllableMob) || !obj.isCreature())
{ {
activeChar.sendPacket(SystemMessageId.INVALID_TARGET); activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
} }

View File

@ -108,7 +108,7 @@ public class AdminKill implements IAdminCommandHandler
else else
{ {
final WorldObject obj = activeChar.getTarget(); final WorldObject obj = activeChar.getTarget();
if ((obj instanceof ControllableMob) || !obj.isCreature()) if ((obj == null) || (obj instanceof ControllableMob) || !obj.isCreature())
{ {
activeChar.sendPacket(SystemMessageId.INVALID_TARGET); activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
} }

View File

@ -108,7 +108,7 @@ public class AdminKill implements IAdminCommandHandler
else else
{ {
final WorldObject obj = activeChar.getTarget(); final WorldObject obj = activeChar.getTarget();
if ((obj instanceof ControllableMob) || !obj.isCreature()) if ((obj == null) || (obj instanceof ControllableMob) || !obj.isCreature())
{ {
activeChar.sendPacket(SystemMessageId.INVALID_TARGET); activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
} }

View File

@ -108,7 +108,7 @@ public class AdminKill implements IAdminCommandHandler
else else
{ {
final WorldObject obj = activeChar.getTarget(); final WorldObject obj = activeChar.getTarget();
if ((obj instanceof ControllableMob) || !obj.isCreature()) if ((obj == null) || (obj instanceof ControllableMob) || !obj.isCreature())
{ {
activeChar.sendPacket(SystemMessageId.INVALID_TARGET); activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
} }

View File

@ -108,7 +108,7 @@ public class AdminKill implements IAdminCommandHandler
else else
{ {
final WorldObject obj = activeChar.getTarget(); final WorldObject obj = activeChar.getTarget();
if ((obj instanceof ControllableMob) || !obj.isCreature()) if ((obj == null) || (obj instanceof ControllableMob) || !obj.isCreature())
{ {
activeChar.sendPacket(SystemMessageId.INVALID_TARGET); activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
} }

View File

@ -108,7 +108,7 @@ public class AdminKill implements IAdminCommandHandler
else else
{ {
final WorldObject obj = activeChar.getTarget(); final WorldObject obj = activeChar.getTarget();
if ((obj instanceof ControllableMob) || !obj.isCreature()) if ((obj == null) || (obj instanceof ControllableMob) || !obj.isCreature())
{ {
activeChar.sendPacket(SystemMessageId.INVALID_TARGET); activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
} }

View File

@ -108,7 +108,7 @@ public class AdminKill implements IAdminCommandHandler
else else
{ {
final WorldObject obj = activeChar.getTarget(); final WorldObject obj = activeChar.getTarget();
if ((obj instanceof ControllableMob) || !obj.isCreature()) if ((obj == null) || (obj instanceof ControllableMob) || !obj.isCreature())
{ {
activeChar.sendPacket(SystemMessageId.INVALID_TARGET); activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
} }