diff options
author | ariel- <ariel-@users.noreply.github.com> | 2017-03-16 00:24:52 -0300 |
---|---|---|
committer | funjoker <funjoker109@gmail.com> | 2020-04-24 17:18:48 +0200 |
commit | 4472a3cbf366f11b1c0d0eaa782e045c95f0254b (patch) | |
tree | 84c43388f5744dcc2382f6ab3f8fe004f0ec0cbe /src/server/game/Globals/ObjectMgr.cpp | |
parent | a098b454b8292839ae246735cf27340b1080f190 (diff) |
Core/Globals: Fix Quest codestyle and member variable initialization
(cherry picked from commit 09701b0229f84e3c0b014f6a161f945f3d226d8b)
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rw-r--r-- | src/server/game/Globals/ObjectMgr.cpp | 248 |
1 files changed, 124 insertions, 124 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index abc2a7b9189..54bb035b11c 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -4103,223 +4103,223 @@ void ObjectMgr::LoadQuests() if (qinfo->GetQuestType() >= MAX_QUEST_TYPES) TC_LOG_ERROR("sql.sql", "Quest %u has `Method` = %u, expected values are 0, 1 or 2.", qinfo->GetQuestId(), qinfo->GetQuestType()); - if (qinfo->SpecialFlags & ~QUEST_SPECIAL_FLAGS_DB_ALLOWED) + if (qinfo->_specialFlags & ~QUEST_SPECIAL_FLAGS_DB_ALLOWED) { TC_LOG_ERROR("sql.sql", "Quest %u has `SpecialFlags` = %u > max allowed value. Correct `SpecialFlags` to value <= %u", - qinfo->GetQuestId(), qinfo->SpecialFlags, QUEST_SPECIAL_FLAGS_DB_ALLOWED); - qinfo->SpecialFlags &= QUEST_SPECIAL_FLAGS_DB_ALLOWED; + qinfo->GetQuestId(), qinfo->_specialFlags, QUEST_SPECIAL_FLAGS_DB_ALLOWED); + qinfo->_specialFlags &= QUEST_SPECIAL_FLAGS_DB_ALLOWED; } - if (qinfo->Flags & QUEST_FLAGS_DAILY && qinfo->Flags & QUEST_FLAGS_WEEKLY) + if (qinfo->_flags & QUEST_FLAGS_DAILY && qinfo->_flags & QUEST_FLAGS_WEEKLY) { TC_LOG_ERROR("sql.sql", "Weekly Quest %u is marked as daily quest in `Flags`, removed daily flag.", qinfo->GetQuestId()); - qinfo->Flags &= ~QUEST_FLAGS_DAILY; + qinfo->_flags &= ~QUEST_FLAGS_DAILY; } - if (qinfo->Flags & QUEST_FLAGS_DAILY) + if (qinfo->_flags & QUEST_FLAGS_DAILY) { - if (!(qinfo->SpecialFlags & QUEST_SPECIAL_FLAGS_REPEATABLE)) + if (!(qinfo->_specialFlags & QUEST_SPECIAL_FLAGS_REPEATABLE)) { TC_LOG_DEBUG("sql.sql", "Daily Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId()); - qinfo->SpecialFlags |= QUEST_SPECIAL_FLAGS_REPEATABLE; + qinfo->_specialFlags |= QUEST_SPECIAL_FLAGS_REPEATABLE; } } - if (qinfo->Flags & QUEST_FLAGS_WEEKLY) + if (qinfo->_flags & QUEST_FLAGS_WEEKLY) { - if (!(qinfo->SpecialFlags & QUEST_SPECIAL_FLAGS_REPEATABLE)) + if (!(qinfo->_specialFlags & QUEST_SPECIAL_FLAGS_REPEATABLE)) { TC_LOG_DEBUG("sql.sql", "Weekly Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId()); - qinfo->SpecialFlags |= QUEST_SPECIAL_FLAGS_REPEATABLE; + qinfo->_specialFlags |= QUEST_SPECIAL_FLAGS_REPEATABLE; } } - if (qinfo->SpecialFlags & QUEST_SPECIAL_FLAGS_MONTHLY) + if (qinfo->_specialFlags & QUEST_SPECIAL_FLAGS_MONTHLY) { - if (!(qinfo->SpecialFlags & QUEST_SPECIAL_FLAGS_REPEATABLE)) + if (!(qinfo->_specialFlags & QUEST_SPECIAL_FLAGS_REPEATABLE)) { TC_LOG_DEBUG("sql.sql", "Monthly quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId()); - qinfo->SpecialFlags |= QUEST_SPECIAL_FLAGS_REPEATABLE; + qinfo->_specialFlags |= QUEST_SPECIAL_FLAGS_REPEATABLE; } } - if (qinfo->Flags & QUEST_FLAGS_TRACKING) + if (qinfo->_flags & QUEST_FLAGS_TRACKING) { // at auto-reward can be rewarded only RewardChoiceItemId[0] - for (int j = 1; j < QUEST_REWARD_CHOICES_COUNT; ++j ) + for (uint32 j = 1; j < QUEST_REWARD_CHOICES_COUNT; ++j ) { if (uint32 id = qinfo->RewardChoiceItemId[j]) { TC_LOG_ERROR("sql.sql", "Quest %u has `RewardChoiceItemId%d` = %u but item from `RewardChoiceItemId%d` can't be rewarded with quest flag QUEST_FLAGS_TRACKING.", - qinfo->GetQuestId(), j+1, id, j+1); + qinfo->GetQuestId(), j + 1, id, j + 1); // no changes, quest ignore this data } } } - if (qinfo->MinLevel == -1 || qinfo->MinLevel > DEFAULT_MAX_LEVEL) + if (qinfo->_minLevel == -1 || qinfo->_minLevel > DEFAULT_MAX_LEVEL) { - TC_LOG_ERROR("sql.sql", "Quest %u should be disabled because `MinLevel` = %i", qinfo->GetQuestId(), int32(qinfo->MinLevel)); + TC_LOG_ERROR("sql.sql", "Quest %u should be disabled because `MinLevel` = %i", qinfo->GetQuestId(), int32(qinfo->_minLevel)); // no changes needed, sending -1 in SMSG_QUEST_QUERY_RESPONSE is valid } // client quest log visual (area case) - if (qinfo->QuestSortID > 0) + if (qinfo->_questSortID > 0) { - if (!sAreaTableStore.LookupEntry(qinfo->QuestSortID)) + if (!sAreaTableStore.LookupEntry(qinfo->_questSortID)) { TC_LOG_ERROR("sql.sql", "Quest %u has `QuestSortID` = %u (zone case) but zone with this id does not exist.", - qinfo->GetQuestId(), qinfo->QuestSortID); + qinfo->GetQuestId(), qinfo->_questSortID); // no changes, quest not dependent from this value but can have problems at client } } // client quest log visual (sort case) - if (qinfo->QuestSortID < 0) + if (qinfo->_questSortID < 0) { - QuestSortEntry const* qSort = sQuestSortStore.LookupEntry(-int32(qinfo->QuestSortID)); + QuestSortEntry const* qSort = sQuestSortStore.LookupEntry(-int32(qinfo->_questSortID)); if (!qSort) { TC_LOG_ERROR("sql.sql", "Quest %u has `QuestSortID` = %i (sort case) but quest sort with this id does not exist.", - qinfo->GetQuestId(), qinfo->QuestSortID); + qinfo->GetQuestId(), qinfo->_questSortID); // no changes, quest not dependent from this value but can have problems at client (note some may be 0, we must allow this so no check) } //check for proper RequiredSkillId value (skill case) - if (uint32 skill_id = SkillByQuestSort(-int32(qinfo->QuestSortID))) + if (uint32 skill_id = SkillByQuestSort(-int32(qinfo->_questSortID))) { - if (qinfo->RequiredSkillId != skill_id) + if (qinfo->_requiredSkillId != skill_id) { TC_LOG_ERROR("sql.sql", "Quest %u has `QuestSortID` = %i but `RequiredSkillId` does not have a corresponding value (%d).", - qinfo->GetQuestId(), qinfo->QuestSortID, skill_id); + qinfo->GetQuestId(), qinfo->_questSortID, skill_id); //override, and force proper value here? } } } // AllowableClasses, can be 0/CLASSMASK_ALL_PLAYABLE to allow any class - if (qinfo->AllowableClasses) + if (qinfo->_allowableClasses) { - if (!(qinfo->AllowableClasses & CLASSMASK_ALL_PLAYABLE)) + if (!(qinfo->_allowableClasses & CLASSMASK_ALL_PLAYABLE)) { - TC_LOG_ERROR("sql.sql", "Quest %u does not contain any playable classes in `AllowableClasses` (%u), value set to 0 (all classes).", qinfo->GetQuestId(), qinfo->AllowableClasses); - qinfo->AllowableClasses = 0; + TC_LOG_ERROR("sql.sql", "Quest %u does not contain any playable classes in `AllowableClasses` (%u), value set to 0 (all classes).", qinfo->GetQuestId(), qinfo->_allowableClasses); + qinfo->_allowableClasses = 0; } } // AllowableRaces, can be -1/RACEMASK_ALL_PLAYABLE to allow any race - if (qinfo->AllowableRaces.RawValue != uint64(-1)) + if (qinfo->_allowableRaces.RawValue != uint64(-1)) { - if (qinfo->AllowableRaces && !(qinfo->AllowableRaces.RawValue & RACEMASK_ALL_PLAYABLE)) + if (qinfo->_allowableRaces && !(qinfo->_allowableRaces.RawValue & RACEMASK_ALL_PLAYABLE)) { - TC_LOG_ERROR("sql.sql", "Quest %u does not contain any playable races in `AllowableRaces` (" UI64FMTD "), value set to -1 (all races).", qinfo->GetQuestId(), qinfo->AllowableRaces.RawValue); - qinfo->AllowableRaces.RawValue = uint64(-1); + TC_LOG_ERROR("sql.sql", "Quest %u does not contain any playable races in `AllowableRaces` (" UI64FMTD "), value set to -1 (all races).", qinfo->GetQuestId(), qinfo->_allowableRaces.RawValue); + qinfo->_allowableRaces.RawValue = uint64(-1); } } // RequiredSkillId, can be 0 - if (qinfo->RequiredSkillId) + if (qinfo->_requiredSkillId) { - if (!sSkillLineStore.LookupEntry(qinfo->RequiredSkillId)) + if (!sSkillLineStore.LookupEntry(qinfo->_requiredSkillId)) { TC_LOG_ERROR("sql.sql", "Quest %u has `RequiredSkillId` = %u but this skill does not exist", - qinfo->GetQuestId(), qinfo->RequiredSkillId); + qinfo->GetQuestId(), qinfo->_requiredSkillId); } } - if (qinfo->RequiredSkillPoints) + if (qinfo->_requiredSkillPoints) { - if (qinfo->RequiredSkillPoints > sWorld->GetConfigMaxSkillValue()) + if (qinfo->_requiredSkillPoints > sWorld->GetConfigMaxSkillValue()) { TC_LOG_ERROR("sql.sql", "Quest %u has `RequiredSkillPoints` = %u but max possible skill is %u, quest can't be done.", - qinfo->GetQuestId(), qinfo->RequiredSkillPoints, sWorld->GetConfigMaxSkillValue()); + qinfo->GetQuestId(), qinfo->_requiredSkillPoints, sWorld->GetConfigMaxSkillValue()); // no changes, quest can't be done for this requirement } } // else Skill quests can have 0 skill level, this is ok - if (qinfo->RequiredMinRepFaction && !sFactionStore.LookupEntry(qinfo->RequiredMinRepFaction)) + if (qinfo->_requiredMinRepFaction && !sFactionStore.LookupEntry(qinfo->_requiredMinRepFaction)) { TC_LOG_ERROR("sql.sql", "Quest %u has `RequiredMinRepFaction` = %u but faction template %u does not exist, quest can't be done.", - qinfo->GetQuestId(), qinfo->RequiredMinRepFaction, qinfo->RequiredMinRepFaction); + qinfo->GetQuestId(), qinfo->_requiredMinRepFaction, qinfo->_requiredMinRepFaction); // no changes, quest can't be done for this requirement } - if (qinfo->RequiredMaxRepFaction && !sFactionStore.LookupEntry(qinfo->RequiredMaxRepFaction)) + if (qinfo->_requiredMaxRepFaction && !sFactionStore.LookupEntry(qinfo->_requiredMaxRepFaction)) { TC_LOG_ERROR("sql.sql", "Quest %u has `RequiredMaxRepFaction` = %u but faction template %u does not exist, quest can't be done.", - qinfo->GetQuestId(), qinfo->RequiredMaxRepFaction, qinfo->RequiredMaxRepFaction); + qinfo->GetQuestId(), qinfo->_requiredMaxRepFaction, qinfo->_requiredMaxRepFaction); // no changes, quest can't be done for this requirement } - if (qinfo->RequiredMinRepValue && qinfo->RequiredMinRepValue > ReputationMgr::Reputation_Cap) + if (qinfo->_requiredMinRepValue && qinfo->_requiredMinRepValue > ReputationMgr::Reputation_Cap) { TC_LOG_ERROR("sql.sql", "Quest %u has `RequiredMinRepValue` = %d but max reputation is %u, quest can't be done.", - qinfo->GetQuestId(), qinfo->RequiredMinRepValue, ReputationMgr::Reputation_Cap); + qinfo->GetQuestId(), qinfo->_requiredMinRepValue, ReputationMgr::Reputation_Cap); // no changes, quest can't be done for this requirement } - if (qinfo->RequiredMinRepValue && qinfo->RequiredMaxRepValue && qinfo->RequiredMaxRepValue <= qinfo->RequiredMinRepValue) + if (qinfo->_requiredMinRepValue && qinfo->_requiredMaxRepValue && qinfo->_requiredMaxRepValue <= qinfo->_requiredMinRepValue) { TC_LOG_ERROR("sql.sql", "Quest %u has `RequiredMaxRepValue` = %d and `RequiredMinRepValue` = %d, quest can't be done.", - qinfo->GetQuestId(), qinfo->RequiredMaxRepValue, qinfo->RequiredMinRepValue); + qinfo->GetQuestId(), qinfo->_requiredMaxRepValue, qinfo->_requiredMinRepValue); // no changes, quest can't be done for this requirement } - if (!qinfo->RequiredMinRepFaction && qinfo->RequiredMinRepValue != 0) + if (!qinfo->_requiredMinRepFaction && qinfo->_requiredMinRepValue != 0) { TC_LOG_ERROR("sql.sql", "Quest %u has `RequiredMinRepValue` = %d but `RequiredMinRepFaction` is 0, value has no effect", - qinfo->GetQuestId(), qinfo->RequiredMinRepValue); + qinfo->GetQuestId(), qinfo->_requiredMinRepValue); // warning } - if (!qinfo->RequiredMaxRepFaction && qinfo->RequiredMaxRepValue != 0) + if (!qinfo->_requiredMaxRepFaction && qinfo->_requiredMaxRepValue != 0) { TC_LOG_ERROR("sql.sql", "Quest %u has `RequiredMaxRepValue` = %d but `RequiredMaxRepFaction` is 0, value has no effect", - qinfo->GetQuestId(), qinfo->RequiredMaxRepValue); + qinfo->GetQuestId(), qinfo->_requiredMaxRepValue); // warning } - if (qinfo->RewardTitleId && !sCharTitlesStore.LookupEntry(qinfo->RewardTitleId)) + if (qinfo->_rewardTitleId && !sCharTitlesStore.LookupEntry(qinfo->_rewardTitleId)) { TC_LOG_ERROR("sql.sql", "Quest %u has `RewardTitleId` = %u but CharTitle Id %u does not exist, quest can't be rewarded with title.", - qinfo->GetQuestId(), qinfo->RewardTitleId, qinfo->RewardTitleId); - qinfo->RewardTitleId = 0; + qinfo->GetQuestId(), qinfo->_rewardTitleId, qinfo->_rewardTitleId); + qinfo->_rewardTitleId = 0; // quest can't reward this title } - if (qinfo->SourceItemId) + if (qinfo->_sourceItemId) { - if (!sObjectMgr->GetItemTemplate(qinfo->SourceItemId)) + if (!sObjectMgr->GetItemTemplate(qinfo->_sourceItemId)) { TC_LOG_ERROR("sql.sql", "Quest %u has `SourceItemId` = %u but item with entry %u does not exist, quest can't be done.", - qinfo->GetQuestId(), qinfo->SourceItemId, qinfo->SourceItemId); - qinfo->SourceItemId = 0; // quest can't be done for this requirement + qinfo->GetQuestId(), qinfo->_sourceItemId, qinfo->_sourceItemId); + qinfo->_sourceItemId = 0; // quest can't be done for this requirement } - else if (qinfo->SourceItemIdCount == 0) + else if (qinfo->_sourceItemIdCount == 0) { TC_LOG_ERROR("sql.sql", "Quest %u has `StartItem` = %u but `ProvidedItemCount` = 0, set to 1 but need fix in DB.", - qinfo->GetQuestId(), qinfo->SourceItemId); - qinfo->SourceItemIdCount = 1; // update to 1 for allow quest work for backward compatibility with DB + qinfo->GetQuestId(), qinfo->_sourceItemId); + qinfo->_sourceItemIdCount = 1; // update to 1 for allow quest work for backward compatibility with DB } } - else if (qinfo->SourceItemIdCount>0) + else if (qinfo->_sourceItemIdCount > 0) { TC_LOG_ERROR("sql.sql", "Quest %u has `SourceItemId` = 0 but `SourceItemIdCount` = %u, useless value.", - qinfo->GetQuestId(), qinfo->SourceItemIdCount); - qinfo->SourceItemIdCount=0; // no quest work changes in fact + qinfo->GetQuestId(), qinfo->_sourceItemIdCount); + qinfo->_sourceItemIdCount = 0; // no quest work changes in fact } - if (qinfo->SourceSpellID) + if (qinfo->_sourceSpellID) { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(qinfo->SourceSpellID); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(qinfo->_sourceSpellID); if (!spellInfo) { TC_LOG_ERROR("sql.sql", "Quest %u has `SourceSpellid` = %u but spell %u doesn't exist, quest can't be done.", - qinfo->GetQuestId(), qinfo->SourceSpellID, qinfo->SourceSpellID); - qinfo->SourceSpellID = 0; // quest can't be done for this requirement + qinfo->GetQuestId(), qinfo->_sourceSpellID, qinfo->_sourceSpellID); + qinfo->_sourceSpellID = 0; // quest can't be done for this requirement } else if (!SpellMgr::IsSpellValid(spellInfo)) { TC_LOG_ERROR("sql.sql", "Quest %u has `SourceSpellid` = %u but spell %u is broken, quest can't be done.", - qinfo->GetQuestId(), qinfo->SourceSpellID, qinfo->SourceSpellID); - qinfo->SourceSpellID = 0; // quest can't be done for this requirement + qinfo->GetQuestId(), qinfo->_sourceSpellID, qinfo->_sourceSpellID); + qinfo->_sourceSpellID = 0; // quest can't be done for this requirement } } @@ -4501,7 +4501,7 @@ void ObjectMgr::LoadQuests() { if (qinfo->RewardFactionId[j]) { - if (abs(qinfo->RewardFactionValue[j]) > 9) + if (std::abs(qinfo->RewardFactionValue[j]) > 9) { TC_LOG_ERROR("sql.sql", "Quest %u has RewardFactionValueId%d = %i. That is outside the range of valid values (-9 to 9).", qinfo->GetQuestId(), j+1, qinfo->RewardFactionValue[j]); } @@ -4542,59 +4542,59 @@ void ObjectMgr::LoadQuests() } } - if (qinfo->RewardSpell > 0) + if (qinfo->_rewardSpell > 0) { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(qinfo->RewardSpell); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(qinfo->_rewardSpell); if (!spellInfo) { TC_LOG_ERROR("sql.sql", "Quest %u has `RewardSpellCast` = %u but spell %u does not exist, quest will not have a spell reward.", - qinfo->GetQuestId(), qinfo->RewardSpell, qinfo->RewardSpell); - qinfo->RewardSpell = 0; // no spell will be cast on player + qinfo->GetQuestId(), qinfo->_rewardSpell, qinfo->_rewardSpell); + qinfo->_rewardSpell = 0; // no spell will be cast on player } else if (!SpellMgr::IsSpellValid(spellInfo)) { TC_LOG_ERROR("sql.sql", "Quest %u has `RewardSpellCast` = %u but spell %u is broken, quest will not have a spell reward.", - qinfo->GetQuestId(), qinfo->RewardSpell, qinfo->RewardSpell); - qinfo->RewardSpell = 0; // no spell will be cast on player + qinfo->GetQuestId(), qinfo->_rewardSpell, qinfo->_rewardSpell); + qinfo->_rewardSpell = 0; // no spell will be cast on player } } - if (qinfo->RewardMailTemplateId) + if (qinfo->_rewardMailTemplateId) { - if (!sMailTemplateStore.LookupEntry(qinfo->RewardMailTemplateId)) + if (!sMailTemplateStore.LookupEntry(qinfo->_rewardMailTemplateId)) { TC_LOG_ERROR("sql.sql", "Quest %u has `RewardMailTemplateId` = %u but mail template %u does not exist, quest will not have a mail reward.", - qinfo->GetQuestId(), qinfo->RewardMailTemplateId, qinfo->RewardMailTemplateId); - qinfo->RewardMailTemplateId = 0; // no mail will send to player - qinfo->RewardMailDelay = 0; // no mail will send to player - qinfo->RewardMailSenderEntry = 0; + qinfo->GetQuestId(), qinfo->_rewardMailTemplateId, qinfo->_rewardMailTemplateId); + qinfo->_rewardMailTemplateId = 0; // no mail will send to player + qinfo->_rewardMailDelay = 0; // no mail will send to player + qinfo->_rewardMailSenderEntry = 0; } - else if (usedMailTemplates.find(qinfo->RewardMailTemplateId) != usedMailTemplates.end()) + else if (usedMailTemplates.find(qinfo->_rewardMailTemplateId) != usedMailTemplates.end()) { - std::map<uint32, uint32>::const_iterator used_mt_itr = usedMailTemplates.find(qinfo->RewardMailTemplateId); + auto used_mt_itr = usedMailTemplates.find(qinfo->_rewardMailTemplateId); TC_LOG_ERROR("sql.sql", "Quest %u has `RewardMailTemplateId` = %u but mail template %u already used for quest %u, quest will not have a mail reward.", - qinfo->GetQuestId(), qinfo->RewardMailTemplateId, qinfo->RewardMailTemplateId, used_mt_itr->second); - qinfo->RewardMailTemplateId = 0; // no mail will send to player - qinfo->RewardMailDelay = 0; // no mail will send to player - qinfo->RewardMailSenderEntry = 0; + qinfo->GetQuestId(), qinfo->_rewardMailTemplateId, qinfo->_rewardMailTemplateId, used_mt_itr->second); + qinfo->_rewardMailTemplateId = 0; // no mail will send to player + qinfo->_rewardMailDelay = 0; // no mail will send to player + qinfo->_rewardMailSenderEntry = 0; } else - usedMailTemplates[qinfo->RewardMailTemplateId] = qinfo->GetQuestId(); + usedMailTemplates.emplace(qinfo->_rewardMailTemplateId, qinfo->GetQuestId()); } - if (qinfo->NextQuestInChain) + if (qinfo->_nextQuestInChain) { - QuestMap::iterator qNextItr = _questTemplates.find(qinfo->NextQuestInChain); + auto qNextItr = _questTemplates.find(qinfo->_nextQuestInChain); if (qNextItr == _questTemplates.end()) { TC_LOG_ERROR("sql.sql", "Quest %u has `NextQuestInChain` = %u but quest %u does not exist, quest chain will not work.", - qinfo->GetQuestId(), qinfo->NextQuestInChain, qinfo->NextQuestInChain); - qinfo->NextQuestInChain = 0; + qinfo->GetQuestId(), qinfo->_nextQuestInChain, qinfo->_nextQuestInChain); + qinfo->_nextQuestInChain = 0; } else - qNextItr->second->prevChainQuests.push_back(qinfo->GetQuestId()); + qNextItr->second->PrevChainQuests.push_back(qinfo->GetQuestId()); } for (uint8 j = 0; j < QUEST_REWARD_CURRENCY_COUNT; ++j) @@ -4623,79 +4623,79 @@ void ObjectMgr::LoadQuests() } } - if (qinfo->SoundAccept) + if (qinfo->_soundAccept) { - if (!sSoundKitStore.LookupEntry(qinfo->SoundAccept)) + if (!sSoundKitStore.LookupEntry(qinfo->_soundAccept)) { TC_LOG_ERROR("sql.sql", "Quest %u has `SoundAccept` = %u but sound %u does not exist, set to 0.", - qinfo->GetQuestId(), qinfo->SoundAccept, qinfo->SoundAccept); - qinfo->SoundAccept = 0; // no sound will be played + qinfo->GetQuestId(), qinfo->_soundAccept, qinfo->_soundAccept); + qinfo->_soundAccept = 0; // no sound will be played } } - if (qinfo->SoundTurnIn) + if (qinfo->_soundTurnIn) { - if (!sSoundKitStore.LookupEntry(qinfo->SoundTurnIn)) + if (!sSoundKitStore.LookupEntry(qinfo->_soundTurnIn)) { TC_LOG_ERROR("sql.sql", "Quest %u has `SoundTurnIn` = %u but sound %u does not exist, set to 0.", - qinfo->GetQuestId(), qinfo->SoundTurnIn, qinfo->SoundTurnIn); - qinfo->SoundTurnIn = 0; // no sound will be played + qinfo->GetQuestId(), qinfo->_soundTurnIn, qinfo->_soundTurnIn); + qinfo->_soundTurnIn = 0; // no sound will be played } } - if (qinfo->RewardSkillId) + if (qinfo->_rewardSkillId) { - if (!sSkillLineStore.LookupEntry(qinfo->RewardSkillId)) + if (!sSkillLineStore.LookupEntry(qinfo->_rewardSkillId)) { TC_LOG_ERROR("sql.sql", "Quest %u has `RewardSkillId` = %u but this skill does not exist", - qinfo->GetQuestId(), qinfo->RewardSkillId); + qinfo->GetQuestId(), qinfo->_rewardSkillId); } - if (!qinfo->RewardSkillPoints) + if (!qinfo->_rewardSkillPoints) { TC_LOG_ERROR("sql.sql", "Quest %u has `RewardSkillId` = %u but `RewardSkillPoints` is 0", - qinfo->GetQuestId(), qinfo->RewardSkillId); + qinfo->GetQuestId(), qinfo->_rewardSkillId); } } - if (qinfo->RewardSkillPoints) + if (qinfo->_rewardSkillPoints) { - if (qinfo->RewardSkillPoints > sWorld->GetConfigMaxSkillValue()) + if (qinfo->_rewardSkillPoints > sWorld->GetConfigMaxSkillValue()) { TC_LOG_ERROR("sql.sql", "Quest %u has `RewardSkillPoints` = %u but max possible skill is %u, quest can't be done.", - qinfo->GetQuestId(), qinfo->RewardSkillPoints, sWorld->GetConfigMaxSkillValue()); + qinfo->GetQuestId(), qinfo->_rewardSkillPoints, sWorld->GetConfigMaxSkillValue()); // no changes, quest can't be done for this requirement } - if (!qinfo->RewardSkillId) + if (!qinfo->_rewardSkillId) { TC_LOG_ERROR("sql.sql", "Quest %u has `RewardSkillPoints` = %u but `RewardSkillId` is 0", - qinfo->GetQuestId(), qinfo->RewardSkillPoints); + qinfo->GetQuestId(), qinfo->_rewardSkillPoints); } } // fill additional data stores - if (qinfo->PrevQuestID) + if (qinfo->_prevQuestID) { if (_questTemplates.find(abs(qinfo->GetPrevQuestId())) == _questTemplates.end()) TC_LOG_ERROR("sql.sql", "Quest %d has PrevQuestId %i, but no such quest", qinfo->GetQuestId(), qinfo->GetPrevQuestId()); else - qinfo->prevQuests.push_back(qinfo->PrevQuestID); + qinfo->PrevQuests.push_back(qinfo->_prevQuestID); } - if (qinfo->NextQuestID) + if (qinfo->_nextQuestID) { QuestMap::iterator qNextItr = _questTemplates.find(abs(qinfo->GetNextQuestId())); if (qNextItr == _questTemplates.end()) TC_LOG_ERROR("sql.sql", "Quest %d has NextQuestId %i, but no such quest", qinfo->GetQuestId(), qinfo->GetNextQuestId()); else { - int32 signedQuestId = qinfo->NextQuestID < 0 ? -int32(qinfo->GetQuestId()) : int32(qinfo->GetQuestId()); - qNextItr->second->prevQuests.push_back(signedQuestId); + int32 signedQuestId = qinfo->_nextQuestID < 0 ? -int32(qinfo->GetQuestId()) : int32(qinfo->GetQuestId()); + qNextItr->second->PrevQuests.push_back(signedQuestId); } } - if (qinfo->ExclusiveGroup) - mExclusiveQuestGroups.insert(std::pair<int32, uint32>(qinfo->ExclusiveGroup, qinfo->GetQuestId())); - if (qinfo->LimitTime) + if (qinfo->_exclusiveGroup) + mExclusiveQuestGroups.insert(std::pair<int32, uint32>(qinfo->_exclusiveGroup, qinfo->GetQuestId())); + if (qinfo->_limitTime) qinfo->SetSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED); } |