Replaced instanceof L2Playable with isPlayable method.

This commit is contained in:
MobiusDev
2018-07-02 00:39:38 +00:00
parent e7ac53ba66
commit 6c1d37f4ae
46 changed files with 62 additions and 79 deletions

View File

@@ -51,7 +51,7 @@ public class AdminLevel implements IAdminCommandHandler
{
try
{
if (targetChar instanceof L2Playable)
if ((targetChar != null) && targetChar.isPlayable())
{
((L2Playable) targetChar).getStat().addLevel(Byte.parseByte(val));
}

View File

@@ -26,7 +26,6 @@ import com.l2jmobius.gameserver.cache.HtmCache;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.L2Playable;
import com.l2jmobius.gameserver.model.actor.instance.L2BoatInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.serverpackets.AdminForgePacket;
@@ -475,7 +474,7 @@ public final class AdminPForge implements IAdminCommandHandler
case "$tboid":
{
target = activeChar.getTarget();
if ((target != null) && (target instanceof L2Playable))
if ((target != null) && target.isPlayable())
{
boat = target.getActingPlayer().getBoat();
if (boat != null)