Replaced instanceof L2PetInstance with isPet method.
This commit is contained in:
@@ -61,7 +61,7 @@ public class PlayableStat extends CharStat
|
||||
setExp(getExp() + value);
|
||||
|
||||
byte minimumLevel = 1;
|
||||
if (getActiveChar() instanceof L2PetInstance)
|
||||
if (getActiveChar().isPet())
|
||||
{
|
||||
// get minimum level from L2NpcTemplate
|
||||
minimumLevel = (byte) PetDataTable.getInstance().getPetMinLevel(((L2PetInstance) getActiveChar()).getTemplate().getId());
|
||||
@@ -96,7 +96,7 @@ public class PlayableStat extends CharStat
|
||||
setExp(getExp() - value);
|
||||
|
||||
byte minimumLevel = 1;
|
||||
if (getActiveChar() instanceof L2PetInstance)
|
||||
if (getActiveChar().isPet())
|
||||
{
|
||||
// get minimum level from L2NpcTemplate
|
||||
minimumLevel = (byte) PetDataTable.getInstance().getPetMinLevel(((L2PetInstance) getActiveChar()).getTemplate().getId());
|
||||
|
@@ -40,7 +40,6 @@ import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Summon;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2DoorInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PetInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2ServitorInstance;
|
||||
import com.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import com.l2jmobius.gameserver.model.events.impl.events.OnTvTEventFinish;
|
||||
@@ -817,7 +816,7 @@ public class TvTEvent
|
||||
|
||||
L2PcInstance killerPlayerInstance = null;
|
||||
|
||||
if ((killerCharacter instanceof L2PetInstance) || (killerCharacter instanceof L2ServitorInstance))
|
||||
if (killerCharacter.isPet() || (killerCharacter instanceof L2ServitorInstance))
|
||||
{
|
||||
killerPlayerInstance = ((L2Summon) killerCharacter).getOwner();
|
||||
|
||||
|
@@ -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