[9685] Code style cleanups in quest code.

This commit is contained in:
VladimirMangos 2010-04-07 03:25:05 +04:00
parent ea5788ff70
commit e45d165a8e
6 changed files with 111 additions and 111 deletions

View file

@ -3630,8 +3630,7 @@ void ObjectMgr::LoadQuests()
for(int j = 0; j < QUEST_ITEM_OBJECTIVES_COUNT; ++j ) for(int j = 0; j < QUEST_ITEM_OBJECTIVES_COUNT; ++j )
{ {
uint32 id = qinfo->ReqItemId[j]; if (uint32 id = qinfo->ReqItemId[j])
if(id)
{ {
if (qinfo->ReqItemCount[j] == 0) if (qinfo->ReqItemCount[j] == 0)
{ {
@ -3659,8 +3658,7 @@ void ObjectMgr::LoadQuests()
for(int j = 0; j < QUEST_SOURCE_ITEM_IDS_COUNT; ++j ) for(int j = 0; j < QUEST_SOURCE_ITEM_IDS_COUNT; ++j )
{ {
uint32 id = qinfo->ReqSourceId[j]; if (uint32 id = qinfo->ReqSourceId[j])
if(id)
{ {
if (!sItemStorage.LookupEntry<ItemPrototype>(id)) if (!sItemStorage.LookupEntry<ItemPrototype>(id))
{ {
@ -3682,8 +3680,7 @@ void ObjectMgr::LoadQuests()
for(int j = 0; j < QUEST_OBJECTIVES_COUNT; ++j ) for(int j = 0; j < QUEST_OBJECTIVES_COUNT; ++j )
{ {
uint32 id = qinfo->ReqSpell[j]; if (uint32 id = qinfo->ReqSpell[j])
if(id)
{ {
SpellEntry const* spellInfo = sSpellStore.LookupEntry(id); SpellEntry const* spellInfo = sSpellStore.LookupEntry(id);
if (!spellInfo) if (!spellInfo)
@ -3766,8 +3763,7 @@ void ObjectMgr::LoadQuests()
for(int j = 0; j < QUEST_REWARD_CHOICES_COUNT; ++j ) for(int j = 0; j < QUEST_REWARD_CHOICES_COUNT; ++j )
{ {
uint32 id = qinfo->RewChoiceItemId[j]; if (uint32 id = qinfo->RewChoiceItemId[j])
if(id)
{ {
if (!sItemStorage.LookupEntry<ItemPrototype>(id)) if (!sItemStorage.LookupEntry<ItemPrototype>(id))
{ {
@ -3793,8 +3789,7 @@ void ObjectMgr::LoadQuests()
for(int j = 0; j < QUEST_REWARDS_COUNT; ++j ) for(int j = 0; j < QUEST_REWARDS_COUNT; ++j )
{ {
uint32 id = qinfo->RewItemId[j]; if (uint32 id = qinfo->RewItemId[j])
if(id)
{ {
if (!sItemStorage.LookupEntry<ItemPrototype>(id)) if (!sItemStorage.LookupEntry<ItemPrototype>(id))
{ {

View file

@ -1138,7 +1138,7 @@ void Player::Update( uint32 p_time )
if (!m_timedquests.empty()) if (!m_timedquests.empty())
{ {
std::set<uint32>::iterator iter = m_timedquests.begin(); QuestSet::iterator iter = m_timedquests.begin();
while (iter != m_timedquests.end()) while (iter != m_timedquests.end())
{ {
QuestStatusData& q_status = mQuestStatus[*iter]; QuestStatusData& q_status = mQuestStatus[*iter];

View file

@ -2312,7 +2312,8 @@ class MANGOS_DLL_SPEC Player : public Unit
/*********************************************************/ /*********************************************************/
//We allow only one timed quest active at the same time. Below can then be simple value instead of set. //We allow only one timed quest active at the same time. Below can then be simple value instead of set.
std::set<uint32> m_timedquests; typedef std::set<uint32> QuestSet;
QuestSet m_timedquests;
uint64 m_divider; uint64 m_divider;
uint32 m_ingametime; uint32 m_ingametime;

View file

@ -1329,9 +1329,12 @@ void World::Update(uint32 diff)
{ {
///- Update the different timers ///- Update the different timers
for(int i = 0; i < WUPDATE_COUNT; ++i) for(int i = 0; i < WUPDATE_COUNT; ++i)
{
if (m_timers[i].GetCurrent()>=0) if (m_timers[i].GetCurrent()>=0)
m_timers[i].Update(diff); m_timers[i].Update(diff);
else m_timers[i].SetCurrent(0); else
m_timers[i].SetCurrent(0);
}
///- Update the game time and check for shutdown time ///- Update the game time and check for shutdown time
_UpdateGameTime(); _UpdateGameTime();

View file

@ -164,6 +164,7 @@ enum TimeConstants
MINUTE = 60, MINUTE = 60,
HOUR = MINUTE*60, HOUR = MINUTE*60,
DAY = HOUR*24, DAY = HOUR*24,
WEEK = DAY*7,
MONTH = DAY*30, MONTH = DAY*30,
YEAR = MONTH*12, YEAR = MONTH*12,
IN_MILLISECONDS = 1000 IN_MILLISECONDS = 1000

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "9684" #define REVISION_NR "9685"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__