From 6192bdbe1b4f6dbabae2ad091ceecaf2f637d95e Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Mon, 19 Jul 2010 08:20:37 +0400 Subject: [PATCH] [10224] Small code style cleanup. --- src/game/GameObject.cpp | 27 +++++++++++++-------------- src/shared/revision_nr.h | 2 +- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index 0834d18a1..7387b933f 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -261,9 +261,9 @@ void GameObject::Update(uint32 /*p_time*/) { // traps can have time and can not have GameObjectInfo const* goInfo = GetGOInfo(); - if(goInfo->type == GAMEOBJECT_TYPE_TRAP) + if (goInfo->type == GAMEOBJECT_TYPE_TRAP) { - if(m_cooldownTime >= time(NULL)) + if (m_cooldownTime >= time(NULL)) return; // traps @@ -274,13 +274,13 @@ void GameObject::Update(uint32 /*p_time*/) //FIXME: this is activation radius (in different casting radius that must be selected from spell data) //TODO: move activated state code (cast itself) to GO_ACTIVATED, in this place only check activating and set state float radius = float(goInfo->trap.radius); - if(!radius) + if (!radius) { - if(goInfo->trap.cooldown != 3) // cast in other case (at some triggering/linked go/etc explicit call) + if (goInfo->trap.cooldown != 3) // cast in other case (at some triggering/linked go/etc explicit call) return; else { - if(m_respawnTime > 0) + if (m_respawnTime > 0) break; // battlegrounds gameobjects has data2 == 0 && data5 == 3 @@ -291,7 +291,7 @@ void GameObject::Update(uint32 /*p_time*/) // Note: this hack with search required until GO casting not implemented // search unfriendly creature - if(owner && goInfo->trap.charges > 0) // hunter trap + if (owner && goInfo->trap.charges > 0) // hunter trap { MaNGOS::AnyUnfriendlyUnitInObjectRangeCheck u_check(this, owner, radius); MaNGOS::UnitSearcher checker(this,ok, u_check); @@ -299,7 +299,7 @@ void GameObject::Update(uint32 /*p_time*/) if(!ok) Cell::VisitWorldObjects(this,checker, radius); } - else // environmental trap + else // environmental trap { // environmental damage spells already have around enemies targeting but this not help in case not existed GO casting support @@ -320,29 +320,28 @@ void GameObject::Update(uint32 /*p_time*/) m_cooldownTime = time(NULL) + (goInfo->trap.cooldown ? goInfo->trap.cooldown : uint32(4)); // count charges - if(goInfo->trap.charges > 0) + if (goInfo->trap.charges > 0) AddUse(); - if(IsBattleGroundTrap && ok->GetTypeId() == TYPEID_PLAYER) + if (IsBattleGroundTrap && ok->GetTypeId() == TYPEID_PLAYER) { //BattleGround gameobjects case - if(((Player*)ok)->InBattleGround()) - if(BattleGround *bg = ((Player*)ok)->GetBattleGround()) + if (((Player*)ok)->InBattleGround()) + if (BattleGround *bg = ((Player*)ok)->GetBattleGround()) bg->HandleTriggerBuff(GetGUID()); } } } - if(uint32 max_charges = goInfo->GetCharges()) + if (uint32 max_charges = goInfo->GetCharges()) { if (m_usetimes >= max_charges) { m_usetimes = 0; - SetLootState(GO_JUST_DEACTIVATED); // can be despawned or destroyed + SetLootState(GO_JUST_DEACTIVATED); // can be despawned or destroyed } } } - break; } case GO_ACTIVATED: diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 5c2bce433..ced4220c1 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "10223" + #define REVISION_NR "10224" #endif // __REVISION_NR_H__