From aa25336602ff12d94625c24733ff74a834969aef Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 13 Aug 2012 23:30:42 +0100 Subject: Core/Loading: Re-enable validation for quest_template currency loading --- src/server/game/Globals/ObjectMgr.cpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 1843a68f095..5d974db1d3a 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -4039,23 +4039,21 @@ void ObjectMgr::LoadQuests() for (uint8 j = 0; j < QUEST_REWARD_CURRENCY_COUNT; ++j) { - uint32 currency = qinfo->RewardCurrencyId[j]; - if (currency) + if (qinfo->RewardCurrencyId[j]) { if (qinfo->RewardCurrencyCount[j] == 0) { sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardCurrencyId%d` = %u but `RewardCurrencyCount%d` = 0, quest can't be done.", - qinfo->GetQuestId(), j+1, currency, j+1); + qinfo->GetQuestId(), j+1, qinfo->RewardCurrencyId[j], j+1); // no changes, quest can't be done for this requirement } - /* TODO: Re-enable once currency dbc getters are implemented - if (!sObjectMgr->GetCurrency(currency)) + if (!sCurrencyTypesStore.LookupEntry(qinfo->RewardCurrencyId[j])) { sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardCurrencyId%d` = %u but currency with entry %u does not exist, quest can't be done.", - qinfo->GetQuestId(), j+1, currency, currency); + qinfo->GetQuestId(), j+1, qinfo->RewardCurrencyId[j], qinfo->RewardCurrencyId[j]); qinfo->RewardCurrencyCount[j] = 0; // prevent incorrect work of quest - }*/ + } } else if (qinfo->RewardCurrencyCount[j] > 0) { @@ -4067,23 +4065,21 @@ void ObjectMgr::LoadQuests() for (uint8 j = 0; j < QUEST_REQUIRED_CURRENCY_COUNT; ++j) { - uint32 currency = qinfo->RequiredCurrencyId[j]; - if (currency) + if (qinfo->RequiredCurrencyId[j]) { if (qinfo->RequiredCurrencyCount[j] == 0) { sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredCurrencyId%d` = %u but `RequiredCurrencyCount%d` = 0, quest can't be done.", - qinfo->GetQuestId(), j+1, currency, j+1); + qinfo->GetQuestId(), j+1, qinfo->RequiredCurrencyId[j], j+1); // no changes, quest can't be done for this requirement } - /* TODO: Re-enable once currency dbc getters are implemented - if (!sObjectMgr->GetCurrency(currency)) + if (!sCurrencyTypesStore.LookupEntry(qinfo->RequiredCurrencyId[j])) { sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredCurrencyId%d` = %u but currency with entry %u does not exist, quest can't be done.", - qinfo->GetQuestId(), j+1, currency, currency); + qinfo->GetQuestId(), j+1, qinfo->RequiredCurrencyId[j], qinfo->RequiredCurrencyId[j]); qinfo->RequiredCurrencyCount[j] = 0; // prevent incorrect work of quest - }*/ + } } else if (qinfo->RequiredCurrencyCount[j] > 0) { -- cgit v1.2.3