Deletion must handle instances as well.

This commit is contained in:
MobiusDev
2018-04-12 12:00:55 +00:00
parent 80103efae2
commit 7c9ca42499
7 changed files with 42 additions and 14 deletions

View File

@@ -3037,13 +3037,17 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
{
((L2Npc) summoner).removeSummonedNpc(getObjectId());
}
L2World.getInstance().removeObject(this);
final L2Spawn spawn = npc.getSpawn();
if ((spawn != null) && spawn.isRespawnEnabled())
{
spawn.decreaseCount(npc);
spawn.doSpawn();
}
final Instance instance = getInstanceWorld();
if (instance != null)
{
instance.removeNpc(npc);
}
L2World.getInstance().removeObject(this);
}
else
{

View File

@@ -3037,13 +3037,17 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
{
((L2Npc) summoner).removeSummonedNpc(getObjectId());
}
L2World.getInstance().removeObject(this);
final L2Spawn spawn = npc.getSpawn();
if ((spawn != null) && spawn.isRespawnEnabled())
{
spawn.decreaseCount(npc);
spawn.doSpawn();
}
final Instance instance = getInstanceWorld();
if (instance != null)
{
instance.removeNpc(npc);
}
L2World.getInstance().removeObject(this);
}
else
{

View File

@@ -3037,13 +3037,17 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
{
((L2Npc) summoner).removeSummonedNpc(getObjectId());
}
L2World.getInstance().removeObject(this);
final L2Spawn spawn = npc.getSpawn();
if ((spawn != null) && spawn.isRespawnEnabled())
{
spawn.decreaseCount(npc);
spawn.doSpawn();
}
final Instance instance = getInstanceWorld();
if (instance != null)
{
instance.removeNpc(npc);
}
L2World.getInstance().removeObject(this);
}
else
{

View File

@@ -3037,13 +3037,17 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
{
((L2Npc) summoner).removeSummonedNpc(getObjectId());
}
L2World.getInstance().removeObject(this);
final L2Spawn spawn = npc.getSpawn();
if ((spawn != null) && spawn.isRespawnEnabled())
{
spawn.decreaseCount(npc);
spawn.doSpawn();
}
final Instance instance = getInstanceWorld();
if (instance != null)
{
instance.removeNpc(npc);
}
L2World.getInstance().removeObject(this);
}
else
{

View File

@@ -4032,13 +4032,17 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
{
((L2Npc) summoner).removeSummonedNpc(getObjectId());
}
L2World.getInstance().removeObject(this);
final L2Spawn spawn = npc.getSpawn();
if ((spawn != null) && spawn.isRespawnEnabled())
{
spawn.decreaseCount(npc);
spawn.doSpawn();
}
final Instance instance = InstanceManager.getInstance().getInstance(getInstanceId());
if (instance != null)
{
instance.removeNpc(npc);
}
L2World.getInstance().removeObject(this);
}
else
{

View File

@@ -3037,13 +3037,17 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
{
((L2Npc) summoner).removeSummonedNpc(getObjectId());
}
L2World.getInstance().removeObject(this);
final L2Spawn spawn = npc.getSpawn();
if ((spawn != null) && spawn.isRespawnEnabled())
{
spawn.decreaseCount(npc);
spawn.doSpawn();
}
final Instance instance = getInstanceWorld();
if (instance != null)
{
instance.removeNpc(npc);
}
L2World.getInstance().removeObject(this);
}
else
{

View File

@@ -3037,13 +3037,17 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
{
((L2Npc) summoner).removeSummonedNpc(getObjectId());
}
L2World.getInstance().removeObject(this);
final L2Spawn spawn = npc.getSpawn();
if ((spawn != null) && spawn.isRespawnEnabled())
{
spawn.decreaseCount(npc);
spawn.doSpawn();
}
final Instance instance = getInstanceWorld();
if (instance != null)
{
instance.removeNpc(npc);
}
L2World.getInstance().removeObject(this);
}
else
{