diff options
author | SnapperRy <snapperryen@gmail.com> | 2016-06-28 18:01:03 +0200 |
---|---|---|
committer | MitchesD <majklprofik@seznam.cz> | 2016-06-28 18:01:03 +0200 |
commit | c853a83dd050092a42c0ebbc4cbc0454fd9e8fbb (patch) | |
tree | b6f37f75a75326543f95dbec7a3e843525953e68 | |
parent | aa59ec4ee786343a5369e465cc704c6be79a790d (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)
-rw-r--r-- | src/server/game/Quests/QuestDef.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index 4a4ee9bff9c..ca1a0950c7e 100644 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -132,7 +132,15 @@ Quest::Quest(Field* questRecord) void Quest::LoadQuestDetails(Field* fields) { for (int 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 (int i = 0; i < QUEST_EMOTE_COUNT; ++i) DetailsEmoteDelay[i] = fields[5+i].GetUInt32(); @@ -142,13 +150,28 @@ 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()); + RequestItemsText = fields[3].GetString(); } void Quest::LoadQuestOfferReward(Field* fields) { for (int 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 (int i = 0; i < QUEST_EMOTE_COUNT; ++i) OfferRewardEmoteDelay[i] = fields[5+i].GetUInt32(); |