From aeb5e3bea603ac77207f0039fb1ce18bc3776e5f Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Wed, 2 Aug 2017 22:25:04 +0000 Subject: [PATCH] Proper instance NPC deletion. --- .../l2jmobius/gameserver/model/events/timers/TimerHolder.java | 2 +- .../com/l2jmobius/gameserver/model/instancezone/Instance.java | 1 + L2J_Mobius_Classic/readme.txt | 2 ++ .../l2jmobius/gameserver/model/events/timers/TimerHolder.java | 2 +- .../com/l2jmobius/gameserver/model/instancezone/Instance.java | 1 + .../l2jmobius/gameserver/model/events/timers/TimerHolder.java | 2 +- .../com/l2jmobius/gameserver/model/instancezone/Instance.java | 1 + 7 files changed, 8 insertions(+), 3 deletions(-) diff --git a/L2J_Mobius_Classic/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java b/L2J_Mobius_Classic/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java index aef7df0f86..1a0961ed28 100644 --- a/L2J_Mobius_Classic/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java +++ b/L2J_Mobius_Classic/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java @@ -112,7 +112,7 @@ public class TimerHolder implements Runnable return false; } - _task.cancel(false); + _task.cancel(true); _cancelScript.onTimerCancel(this); return true; } diff --git a/L2J_Mobius_Classic/java/com/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_Classic/java/com/l2jmobius/gameserver/model/instancezone/Instance.java index a7bc848042..c55257fc29 100644 --- a/L2J_Mobius_Classic/java/com/l2jmobius/gameserver/model/instancezone/Instance.java +++ b/L2J_Mobius_Classic/java/com/l2jmobius/gameserver/model/instancezone/Instance.java @@ -642,6 +642,7 @@ public final class Instance implements IIdentifiable, INamable public void removeNpcs() { _spawns.forEach(SpawnTemplate::despawnAll); + _npcs.forEach(L2Npc::deleteMe); _npcs.clear(); } diff --git a/L2J_Mobius_Classic/readme.txt b/L2J_Mobius_Classic/readme.txt index 647a47f8be..6143499c04 100644 --- a/L2J_Mobius_Classic/readme.txt +++ b/L2J_Mobius_Classic/readme.txt @@ -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 diff --git a/L2J_Mobius_Helios/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java b/L2J_Mobius_Helios/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java index aef7df0f86..1a0961ed28 100644 --- a/L2J_Mobius_Helios/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java +++ b/L2J_Mobius_Helios/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java @@ -112,7 +112,7 @@ public class TimerHolder implements Runnable return false; } - _task.cancel(false); + _task.cancel(true); _cancelScript.onTimerCancel(this); return true; } diff --git a/L2J_Mobius_Helios/java/com/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_Helios/java/com/l2jmobius/gameserver/model/instancezone/Instance.java index a7bc848042..c55257fc29 100644 --- a/L2J_Mobius_Helios/java/com/l2jmobius/gameserver/model/instancezone/Instance.java +++ b/L2J_Mobius_Helios/java/com/l2jmobius/gameserver/model/instancezone/Instance.java @@ -642,6 +642,7 @@ public final class Instance implements IIdentifiable, INamable public void removeNpcs() { _spawns.forEach(SpawnTemplate::despawnAll); + _npcs.forEach(L2Npc::deleteMe); _npcs.clear(); } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java index aef7df0f86..1a0961ed28 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java @@ -112,7 +112,7 @@ public class TimerHolder implements Runnable return false; } - _task.cancel(false); + _task.cancel(true); _cancelScript.onTimerCancel(this); return true; } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/instancezone/Instance.java index a7bc848042..c55257fc29 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/instancezone/Instance.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/instancezone/Instance.java @@ -642,6 +642,7 @@ public final class Instance implements IIdentifiable, INamable public void removeNpcs() { _spawns.forEach(SpawnTemplate::despawnAll); + _npcs.forEach(L2Npc::deleteMe); _npcs.clear(); }