fix(Core/Quest): Throw error if quest_template RewardItemId is not se… (#17924)

fix(Core/Quest): Throw error if quest_template RewardItemId is not set in order

* closes https://github.com/azerothcore/azerothcore-wotlk/issues/17740
This commit is contained in:
Kitzunu
2023-12-03 13:38:51 +01:00
committed by GitHub
parent 9cd95bd728
commit 4fb0464b60

View File

@@ -4942,6 +4942,25 @@ void ObjectMgr::LoadQuests()
}
}
for (uint8 j = 0; j < QUEST_REWARDS_COUNT; ++j)
{
if (!qinfo->RewardItemId[0] && qinfo->RewardItemId[j])
{
LOG_ERROR("sql.sql", "Quest {} has no `RewardItemId1` but has `RewardItem{}`. Reward item will not be loaded.",
qinfo->GetQuestId(), j + 1);
}
if (!qinfo->RewardItemId[1] && j > 1 && qinfo->RewardItemId[j])
{
LOG_ERROR("sql.sql", "Quest {} has no `RewardItemId2` but has `RewardItem{}`. Reward item will not be loaded.",
qinfo->GetQuestId(), j + 1);
}
if (!qinfo->RewardItemId[2] && j > 2 && qinfo->RewardItemId[j])
{
LOG_ERROR("sql.sql", "Quest {} has no `RewardItemId3` but has `RewardItem{}`. Reward item will not be loaded.",
qinfo->GetQuestId(), j + 1);
}
}
for (uint8 j = 0; j < QUEST_REWARDS_COUNT; ++j)
{
uint32 id = qinfo->RewardItemId[j];