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; return false;
} }
_task.cancel(false); _task.cancel(true);
_cancelScript.onTimerCancel(this); _cancelScript.onTimerCancel(this);
return true; return true;
} }

View File

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

View File

@@ -47,3 +47,5 @@ TODO list
-Floran Agricultural Area clan halls -Floran Agricultural Area clan halls
-Test castle sieges -Test castle sieges
-Whisper of Dreams quests -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; return false;
} }
_task.cancel(false); _task.cancel(true);
_cancelScript.onTimerCancel(this); _cancelScript.onTimerCancel(this);
return true; return true;
} }

View File

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

View File

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

View File

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