mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 18:15:31 +01:00
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)
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user