aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Quests/QuestDef.cpp
diff options
context:
space:
mode:
authorSnapperRy <snapperryen@gmail.com>2016-06-28 18:01:03 +0200
committerjoschiwald <joschiwald.trinity@gmail.com>2017-02-04 18:06:26 +0100
commit101d5ed95313434b18a676c75944dc14e3d11f3e (patch)
treee919f7fadae40896d94432253dd5ba98341bbbea /src/server/game/Quests/QuestDef.cpp
parent1f6be58ca39ea4a5e4dfe5e5d67a958ea5bb970f (diff)
Core/Loading: output error when specified emote id for some quest-related tables is invalid (#17469)
* Core/Loading: output error when specified emote id for some quest-related tables is invalid * Apply suggested changes (and kill whitespace) (cherry picked from commit c853a83dd050092a42c0ebbc4cbc0454fd9e8fbb) # Conflicts: # src/server/game/Quests/QuestDef.cpp
Diffstat (limited to 'src/server/game/Quests/QuestDef.cpp')
-rw-r--r--src/server/game/Quests/QuestDef.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp
index a96bfc423f7..06d0bda9443 100644
--- a/src/server/game/Quests/QuestDef.cpp
+++ b/src/server/game/Quests/QuestDef.cpp
@@ -140,7 +140,15 @@ Quest::Quest(Field* questRecord)
void Quest::LoadQuestDetails(Field* fields)
{
for (uint32 i = 0; i < QUEST_EMOTE_COUNT; ++i)
+ {
+ if (!sEmotesStore.LookupEntry(fields[1 + i].GetUInt16()))
+ {
+ TC_LOG_ERROR("sql.sql", "Table `quest_details` has non-existing Emote%i (%u) set for quest %u. Skipped.", 1+i, fields[1+i].GetUInt16(), fields[0].GetUInt32());
+ continue;
+ }
+
DetailsEmote[i] = fields[1 + i].GetUInt16();
+ }
for (uint32 i = 0; i < QUEST_EMOTE_COUNT; ++i)
DetailsEmoteDelay[i] = fields[5 + i].GetUInt32();
@@ -150,6 +158,13 @@ void Quest::LoadQuestRequestItems(Field* fields)
{
EmoteOnComplete = fields[1].GetUInt16();
EmoteOnIncomplete = fields[2].GetUInt16();
+
+ if (!sEmotesStore.LookupEntry(EmoteOnComplete))
+ TC_LOG_ERROR("sql.sql", "Table `quest_request_items` has non-existing EmoteOnComplete (%u) set for quest %u.", EmoteOnComplete, fields[0].GetUInt32());
+
+ if (!sEmotesStore.LookupEntry(EmoteOnIncomplete))
+ TC_LOG_ERROR("sql.sql", "Table `quest_request_items` has non-existing EmoteOnIncomplete (%u) set for quest %u.", EmoteOnIncomplete, fields[0].GetUInt32());
+
EmoteOnCompleteDelay = fields[3].GetUInt32();
EmoteOnIncompleteDelay = fields[4].GetUInt32();
RequestItemsText = fields[5].GetString();
@@ -158,7 +173,15 @@ void Quest::LoadQuestRequestItems(Field* fields)
void Quest::LoadQuestOfferReward(Field* fields)
{
for (uint32 i = 0; i < QUEST_EMOTE_COUNT; ++i)
+ {
+ if (!sEmotesStore.LookupEntry(fields[1 + i].GetUInt16()))
+ {
+ TC_LOG_ERROR("sql.sql", "Table `quest_offer_reward` has non-existing Emote%i (%u) set for quest %u. Skipped.", 1+i, fields[1+i].GetUInt16(), fields[0].GetUInt32());
+ continue;
+ }
+
OfferRewardEmote[i] = fields[1 + i].GetUInt16();
+ }
for (uint32 i = 0; i < QUEST_EMOTE_COUNT; ++i)
OfferRewardEmoteDelay[i] = fields[5 + i].GetUInt32();