Replaced instanceof L2PetInstance with isPet method.
This commit is contained in:
@@ -594,7 +594,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));
|
||||
}
|
||||
@@ -1621,7 +1621,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%", target.getInventory().getTotalWeight() + "/" + target.getMaxLoad());
|
||||
|
@@ -34,7 +34,7 @@ public class PetStatusUpdate implements IClientOutgoingPacket
|
||||
public PetStatusUpdate(L2Summon summon)
|
||||
{
|
||||
_summon = summon;
|
||||
if (_summon instanceof L2PetInstance)
|
||||
if (_summon.isPet())
|
||||
{
|
||||
final L2PetInstance pet = (L2PetInstance) _summon;
|
||||
_curFed = pet.getCurrentFed(); // how fed it is
|
||||
|
Reference in New Issue
Block a user