From 039463f273eaac7ff915f048d66edc816a9b755e Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Sat, 5 Aug 2017 03:56:50 +0000 Subject: [PATCH] Add script checks for registering non existent quest item ids. --- .../java/com/l2jmobius/gameserver/model/quest/Quest.java | 8 ++++++++ .../java/com/l2jmobius/gameserver/model/quest/Quest.java | 8 ++++++++ .../java/com/l2jmobius/gameserver/model/quest/Quest.java | 8 ++++++++ 3 files changed, 24 insertions(+) diff --git a/L2J_Mobius_Classic/java/com/l2jmobius/gameserver/model/quest/Quest.java b/L2J_Mobius_Classic/java/com/l2jmobius/gameserver/model/quest/Quest.java index c3be02e06a..73407c6848 100644 --- a/L2J_Mobius_Classic/java/com/l2jmobius/gameserver/model/quest/Quest.java +++ b/L2J_Mobius_Classic/java/com/l2jmobius/gameserver/model/quest/Quest.java @@ -40,6 +40,7 @@ import com.l2jmobius.commons.database.DatabaseFactory; import com.l2jmobius.commons.util.CommonUtil; import com.l2jmobius.commons.util.Rnd; import com.l2jmobius.gameserver.cache.HtmCache; +import com.l2jmobius.gameserver.datatables.ItemTable; import com.l2jmobius.gameserver.enums.CategoryType; import com.l2jmobius.gameserver.enums.QuestType; import com.l2jmobius.gameserver.enums.Race; @@ -2902,6 +2903,13 @@ public class Quest extends AbstractScript implements IIdentifiable */ public void registerQuestItems(int... items) { + for (int id : items) + { + if ((id != 0) && (ItemTable.getInstance().getTemplate(id) == null)) + { + _log.severe(super.getClass().getSimpleName() + ": Found registerQuestItems for non existing item: " + id + "!"); + } + } _questItemIds = items; } diff --git a/L2J_Mobius_Helios/java/com/l2jmobius/gameserver/model/quest/Quest.java b/L2J_Mobius_Helios/java/com/l2jmobius/gameserver/model/quest/Quest.java index c3be02e06a..71e766c159 100644 --- a/L2J_Mobius_Helios/java/com/l2jmobius/gameserver/model/quest/Quest.java +++ b/L2J_Mobius_Helios/java/com/l2jmobius/gameserver/model/quest/Quest.java @@ -40,6 +40,7 @@ import com.l2jmobius.commons.database.DatabaseFactory; import com.l2jmobius.commons.util.CommonUtil; import com.l2jmobius.commons.util.Rnd; import com.l2jmobius.gameserver.cache.HtmCache; +import com.l2jmobius.gameserver.datatables.ItemTable; import com.l2jmobius.gameserver.enums.CategoryType; import com.l2jmobius.gameserver.enums.QuestType; import com.l2jmobius.gameserver.enums.Race; @@ -2902,6 +2903,13 @@ public class Quest extends AbstractScript implements IIdentifiable */ public void registerQuestItems(int... items) { + for (int id : items) + { + if (ItemTable.getInstance().getTemplate(id) == null) + { + _log.severe(super.getClass().getSimpleName() + ": Found registerQuestItems for non existing item: " + id + "!"); + } + } _questItemIds = items; } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/quest/Quest.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/quest/Quest.java index c3be02e06a..71e766c159 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/quest/Quest.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/quest/Quest.java @@ -40,6 +40,7 @@ import com.l2jmobius.commons.database.DatabaseFactory; import com.l2jmobius.commons.util.CommonUtil; import com.l2jmobius.commons.util.Rnd; import com.l2jmobius.gameserver.cache.HtmCache; +import com.l2jmobius.gameserver.datatables.ItemTable; import com.l2jmobius.gameserver.enums.CategoryType; import com.l2jmobius.gameserver.enums.QuestType; import com.l2jmobius.gameserver.enums.Race; @@ -2902,6 +2903,13 @@ public class Quest extends AbstractScript implements IIdentifiable */ public void registerQuestItems(int... items) { + for (int id : items) + { + if (ItemTable.getInstance().getTemplate(id) == null) + { + _log.severe(super.getClass().getSimpleName() + ": Found registerQuestItems for non existing item: " + id + "!"); + } + } _questItemIds = items; }