From 53a2b8622812f365ca7d31fdbf75fe9a1707ac75 Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 15 Aug 2012 18:00:11 +0100 Subject: [PATCH] Core&DB: Increase the size of MinLevel and MaxLevel to int16 --- ...emplate.sql => 2012_08_13_00_world_quest_template_434.sql} | 0 ...ql => 2012_08_14_00_reputation_spillover_template_434.sql} | 0 ...orld_event_ai.sql => 2012_08_14_00_world_event_ai_434.sql} | 0 ...orld_commands.sql => 2012_08_14_01_world_commands_434.sql} | 0 ..._npc_vendor.sql => 2012_08_14_02_world_npc_vendor_434.sql} | 0 sql/updates/world/2012_08_15_00_world_quest_template_434.sql | 2 ++ src/server/game/Globals/ObjectMgr.cpp | 4 ++-- src/server/game/Quests/QuestDef.cpp | 4 ++-- 8 files changed, 6 insertions(+), 4 deletions(-) rename sql/updates/world/{2012_08_13_00_world_quest_template.sql => 2012_08_13_00_world_quest_template_434.sql} (100%) rename sql/updates/world/{2012_08_14_00_reputation_spillover_template.sql => 2012_08_14_00_reputation_spillover_template_434.sql} (100%) rename sql/updates/world/{2012_08_14_00_world_event_ai.sql => 2012_08_14_00_world_event_ai_434.sql} (100%) rename sql/updates/world/{2012_08_14_01_world_commands.sql => 2012_08_14_01_world_commands_434.sql} (100%) rename sql/updates/world/{2012_08_14_02_world_npc_vendor.sql => 2012_08_14_02_world_npc_vendor_434.sql} (100%) create mode 100644 sql/updates/world/2012_08_15_00_world_quest_template_434.sql diff --git a/sql/updates/world/2012_08_13_00_world_quest_template.sql b/sql/updates/world/2012_08_13_00_world_quest_template_434.sql similarity index 100% rename from sql/updates/world/2012_08_13_00_world_quest_template.sql rename to sql/updates/world/2012_08_13_00_world_quest_template_434.sql diff --git a/sql/updates/world/2012_08_14_00_reputation_spillover_template.sql b/sql/updates/world/2012_08_14_00_reputation_spillover_template_434.sql similarity index 100% rename from sql/updates/world/2012_08_14_00_reputation_spillover_template.sql rename to sql/updates/world/2012_08_14_00_reputation_spillover_template_434.sql diff --git a/sql/updates/world/2012_08_14_00_world_event_ai.sql b/sql/updates/world/2012_08_14_00_world_event_ai_434.sql similarity index 100% rename from sql/updates/world/2012_08_14_00_world_event_ai.sql rename to sql/updates/world/2012_08_14_00_world_event_ai_434.sql diff --git a/sql/updates/world/2012_08_14_01_world_commands.sql b/sql/updates/world/2012_08_14_01_world_commands_434.sql similarity index 100% rename from sql/updates/world/2012_08_14_01_world_commands.sql rename to sql/updates/world/2012_08_14_01_world_commands_434.sql diff --git a/sql/updates/world/2012_08_14_02_world_npc_vendor.sql b/sql/updates/world/2012_08_14_02_world_npc_vendor_434.sql similarity index 100% rename from sql/updates/world/2012_08_14_02_world_npc_vendor.sql rename to sql/updates/world/2012_08_14_02_world_npc_vendor_434.sql diff --git a/sql/updates/world/2012_08_15_00_world_quest_template_434.sql b/sql/updates/world/2012_08_15_00_world_quest_template_434.sql new file mode 100644 index 000000000..423edb1c7 --- /dev/null +++ b/sql/updates/world/2012_08_15_00_world_quest_template_434.sql @@ -0,0 +1,2 @@ +ALTER TABLE `quest_template` CHANGE `MinLevel` `MinLevel` smallint(6) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `MaxLevel` `MaxLevel` smallint(6) NOT NULL DEFAULT '0'; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index ab78566ae..cf5de46a4 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -3550,9 +3550,9 @@ void ObjectMgr::LoadQuests() } } - if (qinfo->MinLevel == uint32(-1)) + if (qinfo->MinLevel == uint32(-1) || qinfo->MinLevel > DEFAULT_MAX_LEVEL) { - sLog->outError(LOG_FILTER_SQL, "Quest %u should be disabled because `MinLevel` = -1", qinfo->GetQuestId()); + sLog->outError(LOG_FILTER_SQL, "Quest %u should be disabled because `MinLevel` = %i", qinfo->GetQuestId(), int32(qinfo->MinLevel)); // no changes needed, sending -1 in SMSG_QUEST_QUERY_RESPONSE is valid } diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index 2240fa471..f259d57d8 100755 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -26,8 +26,8 @@ Quest::Quest(Field* questRecord) Id = questRecord[0].GetUInt32(); Method = questRecord[1].GetUInt8(); Level = questRecord[2].GetInt16(); - MinLevel = uint32(questRecord[3].GetInt8()); - MaxLevel = questRecord[4].GetUInt8(); + MinLevel = uint32(questRecord[3].GetInt16()); + MaxLevel = uint32(questRecord[4].GetInt16()); ZoneOrSort = questRecord[5].GetInt16(); Type = questRecord[6].GetUInt16(); SuggestedPlayers = questRecord[7].GetUInt8();