Replaced instanceof L2PetInstance with isPet method.
This commit is contained in:
@@ -590,7 +590,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
else if (command.startsWith("admin_fullfood"))
|
||||
{
|
||||
final L2Object target = activeChar.getTarget();
|
||||
if (target instanceof L2PetInstance)
|
||||
if ((target != null) && target.isPet())
|
||||
{
|
||||
final L2PetInstance targetPet = (L2PetInstance) target;
|
||||
targetPet.setCurrentFed(targetPet.getMaxFed());
|
||||
@@ -763,7 +763,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
else if (command.startsWith("admin_summon_setlvl"))
|
||||
{
|
||||
final L2Object target = activeChar.getTarget();
|
||||
if (target instanceof L2PetInstance)
|
||||
if ((target != null) && target.isPet())
|
||||
{
|
||||
final L2PetInstance pet = (L2PetInstance) target;
|
||||
try
|
||||
@@ -805,7 +805,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
target = activeChar.getTarget();
|
||||
}
|
||||
|
||||
if (target instanceof L2PetInstance)
|
||||
if ((target != null) && target.isPet())
|
||||
{
|
||||
activeChar.sendPacket(new GMViewItemList((L2PetInstance) target));
|
||||
}
|
||||
@@ -1537,7 +1537,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
html.replace("%mp%", (int) target.getStatus().getCurrentMp() + "/" + target.getStat().getMaxMp());
|
||||
html.replace("%karma%", Integer.toString(target.getKarma()));
|
||||
html.replace("%race%", target.getTemplate().getRace().toString());
|
||||
if (target instanceof L2PetInstance)
|
||||
if (target.isPet())
|
||||
{
|
||||
final int objId = target.getActingPlayer().getObjectId();
|
||||
html.replace("%inv%", " <a action=\"bypass admin_show_pet_inv " + objId + "\">view</a>");
|
||||
@@ -1546,7 +1546,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
{
|
||||
html.replace("%inv%", "none");
|
||||
}
|
||||
if (target instanceof L2PetInstance)
|
||||
if (target.isPet())
|
||||
{
|
||||
html.replace("%food%", ((L2PetInstance) target).getCurrentFed() + "/" + ((L2PetInstance) target).getPetLevelData().getPetMaxFeed());
|
||||
html.replace("%load%", ((L2PetInstance) target).getInventory().getTotalWeight() + "/" + ((L2PetInstance) target).getMaxLoad());
|
||||
|
@@ -36,7 +36,6 @@ import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Summon;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PetInstance;
|
||||
import com.l2jmobius.gameserver.model.holders.ItemChanceHolder;
|
||||
import com.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import com.l2jmobius.gameserver.model.instancezone.InstanceWorld;
|
||||
@@ -969,7 +968,7 @@ public class Q00144_PailakaInjuredDragon extends Quest
|
||||
private void checkMaxSummonLevel(L2PcInstance player)
|
||||
{
|
||||
final L2Summon pet = player.getSummon();
|
||||
if (pet instanceof L2PetInstance)
|
||||
if ((pet != null) && pet.isPet())
|
||||
{
|
||||
if (pet.getLevel() > MAX_SUMMON_LEVEL)
|
||||
{
|
||||
|
Reference in New Issue
Block a user