Proper instance NPC deletion.

This commit is contained in:
MobiusDev
2017-08-02 22:25:04 +00:00
parent 9b0054b645
commit aeb5e3bea6
7 changed files with 8 additions and 3 deletions

View File

@@ -112,7 +112,7 @@ public class TimerHolder<T> implements Runnable
return false;
}
_task.cancel(false);
_task.cancel(true);
_cancelScript.onTimerCancel(this);
return true;
}

View File

@@ -642,6 +642,7 @@ public final class Instance implements IIdentifiable, INamable
public void removeNpcs()
{
_spawns.forEach(SpawnTemplate::despawnAll);
_npcs.forEach(L2Npc::deleteMe);
_npcs.clear();
}

View File

@@ -47,3 +47,5 @@ TODO list
-Floran Agricultural Area clan halls
-Test castle sieges
-Whisper of Dreams quests
-Moon Knight quest
-Dungeon of Abyss https://www.youtube.com/watch?v=FZEu0hjCAK8

View File

@@ -112,7 +112,7 @@ public class TimerHolder<T> implements Runnable
return false;
}
_task.cancel(false);
_task.cancel(true);
_cancelScript.onTimerCancel(this);
return true;
}

View File

@@ -642,6 +642,7 @@ public final class Instance implements IIdentifiable, INamable
public void removeNpcs()
{
_spawns.forEach(SpawnTemplate::despawnAll);
_npcs.forEach(L2Npc::deleteMe);
_npcs.clear();
}

View File

@@ -112,7 +112,7 @@ public class TimerHolder<T> implements Runnable
return false;
}
_task.cancel(false);
_task.cancel(true);
_cancelScript.onTimerCancel(this);
return true;
}

View File

@@ -642,6 +642,7 @@ public final class Instance implements IIdentifiable, INamable
public void removeNpcs()
{
_spawns.forEach(SpawnTemplate::despawnAll);
_npcs.forEach(L2Npc::deleteMe);
_npcs.clear();
}