Cosmetic: Multiple cosmetic changes

- Added missing space to 'if', 'for', 'while' and 'switch' when it's followed by '('
- Added missing space after a comma and remove space before comma (with some exceptions)
- Remove trailing spaces
- Convert tab to spaces

Note: Only affects files with extension "cpp" and "h" under /src/server
This commit is contained in:
Spp
2011-09-29 12:43:05 +02:00
parent 8b820baa73
commit b16d2245bb
390 changed files with 1545 additions and 1545 deletions
@@ -449,7 +449,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster)
float DoneActualBenefit = 0.0f;
// custom amount calculations go here
switch(GetAuraType())
switch (GetAuraType())
{
// crowd control auras
case SPELL_AURA_MOD_CONFUSE:
@@ -483,7 +483,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster)
m_canBeRecalculated = false;
if (!caster)
break;
switch(GetSpellInfo()->SpellFamilyName)
switch (GetSpellInfo()->SpellFamilyName)
{
case SPELLFAMILY_MAGE:
// Ice Barrier
@@ -864,7 +864,7 @@ void AuraEffect::CalculateSpellMod()
switch (GetAuraType())
{
case SPELL_AURA_DUMMY:
switch(GetSpellInfo()->SpellFamilyName)
switch (GetSpellInfo()->SpellFamilyName)
{
case SPELLFAMILY_PRIEST:
// Pain and Suffering
@@ -904,7 +904,7 @@ void AuraEffect::CalculateSpellMod()
break;
}
case SPELL_AURA_MOD_SPELL_CRIT_CHANCE:
switch(GetId())
switch (GetId())
{
case 51466: // Elemental oath
case 51470: // Elemental oath
@@ -1112,21 +1112,21 @@ void AuraEffect::Update(uint32 diff, Unit* caster)
void AuraEffect::UpdatePeriodic(Unit* caster)
{
switch(GetAuraType())
switch (GetAuraType())
{
case SPELL_AURA_DUMMY:
// Haunting Spirits
if (GetId() == 7057)
{
m_amplitude = irand (0 , 60) + 30;
m_amplitude = irand (0, 60) + 30;
m_amplitude *= IN_MILLISECONDS;
}
break;
case SPELL_AURA_PERIODIC_DUMMY:
switch(GetSpellInfo()->SpellFamilyName)
switch (GetSpellInfo()->SpellFamilyName)
{
case SPELLFAMILY_GENERIC:
switch(GetId())
switch (GetId())
{
// Drink
case 430:
@@ -1287,7 +1287,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit* caster) const
Unit* target = aurApp->GetTarget();
switch(GetAuraType())
switch (GetAuraType())
{
case SPELL_AURA_PERIODIC_DUMMY:
HandlePeriodicDummyAuraTick(target, caster);
@@ -1327,7 +1327,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit* caster) const
case SPELL_AURA_DUMMY:
// Haunting Spirits
if (GetId() == 7057)
target->CastSpell((Unit*)NULL , GetAmount(), true);
target->CastSpell((Unit*)NULL, GetAmount(), true);
break;
default:
break;
@@ -1337,7 +1337,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit* caster) const
void AuraEffect::HandleProc(AuraApplication* aurApp, ProcEventInfo& eventInfo)
{
// TODO: effect script handlers here
switch(GetAuraType())
switch (GetAuraType())
{
case SPELL_AURA_PROC_TRIGGER_SPELL:
HandleProcTriggerSpellAuraProc(aurApp, eventInfo);
@@ -1388,7 +1388,7 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const
//uint32 spellId3 = 0;
uint32 HotWSpellId = 0;
switch(GetMiscValue())
switch (GetMiscValue())
{
case FORM_CAT:
spellId = 3025;
@@ -1518,11 +1518,11 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const
}
}
}
switch(GetMiscValue())
switch (GetMiscValue())
{
case FORM_CAT:
// Savage Roar
if (target->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_DRUID, 0 , 0x10000000, 0))
if (target->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_DRUID, 0, 0x10000000, 0))
target->CastSpell(target, 62071, true);
// Nurturing Instinct
if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT, SPELLFAMILY_DRUID, 2254, 0))
@@ -3469,7 +3469,7 @@ void AuraEffect::HandleAuraModStateImmunity(AuraApplication const* aurApp, uint8
target->ApplySpellImmune(GetId(), IMMUNITY_STATE, GetMiscValue(), apply);
if (apply && GetSpellInfo()->AttributesEx & SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY)
target->RemoveAurasByType(AuraType(GetMiscValue()), 0 , GetBase());
target->RemoveAurasByType(AuraType(GetMiscValue()), 0, GetBase());
}
void AuraEffect::HandleAuraModSchoolImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const
@@ -4488,8 +4488,8 @@ void AuraEffect::HandleModDamagePercentDone(AuraApplication const* aurApp, uint8
if (target->GetTypeId() == TYPEID_PLAYER)
{
for(int i = 0; i < MAX_ATTACK; ++i)
if(Item* item = target->ToPlayer()->GetWeaponForAttack(WeaponAttackType(i),false))
for (int i = 0; i < MAX_ATTACK; ++i)
if (Item* item = target->ToPlayer()->GetWeaponForAttack(WeaponAttackType(i), false))
target->ToPlayer()->_ApplyWeaponDependentAuraDamageMod(item, WeaponAttackType(i), this, apply);
}
@@ -4669,7 +4669,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
break;
}
}
switch(GetId())
switch (GetId())
{
case 1515: // Tame beast
// FIX_ME: this is 2.0.12 threat effect replaced in 2.1.x by dummy aura, must be checked for correctness
@@ -4707,7 +4707,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
{
if (caster)
{
switch(caster->getGender())
switch (caster->getGender())
{
case GENDER_FEMALE:
caster->CastSpell(target, 37095, true, NULL, this); // Blood Elf Disguise
@@ -4747,7 +4747,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
case 46354: // Blood Elf Illusion
if (caster)
{
switch(caster->getGender())
switch (caster->getGender())
{
case GENDER_FEMALE:
caster->CastSpell(target, 46356, true, NULL, this);
@@ -4787,7 +4787,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
if (caster) // actually we can also use cast(this, originalcasterguid)
{
int32 damage;
switch(GetBase()->GetStackAmount())
switch (GetBase()->GetStackAmount())
{
case 1: damage = 0; break;
case 2: damage = 500; break;
@@ -4820,7 +4820,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
if ((GetSpellInfo()->IsQuestTame()) && caster && caster->isAlive() && target->isAlive())
{
uint32 finalSpelId = 0;
switch(GetId())
switch (GetId())
{
case 19548: finalSpelId = 19597; break;
case 19674: finalSpelId = 19677; break;
@@ -4846,10 +4846,10 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
caster->CastSpell(target, finalSpelId, true, NULL, this);
}
switch(m_spellInfo->SpellFamilyName)
switch (m_spellInfo->SpellFamilyName)
{
case SPELLFAMILY_GENERIC:
switch(GetId())
switch (GetId())
{
case 2584: // Waiting to Resurrect
// Waiting to resurrect spell cancel, we must remove player from resurrect queue
@@ -4967,13 +4967,13 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
// AT APPLY & REMOVE
switch(m_spellInfo->SpellFamilyName)
switch (m_spellInfo->SpellFamilyName)
{
case SPELLFAMILY_GENERIC:
{
if (!(mode & AURA_EFFECT_HANDLE_REAL))
break;
switch(GetId())
switch (GetId())
{
// Recently Bandaged
case 11196:
@@ -5050,7 +5050,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
case 57723: // Exhaustion
case 57724: // Sated
{
switch(GetId())
switch (GetId())
{
case 57723: target->ApplySpellImmune(GetId(), IMMUNITY_ID, 32182, apply); break; // Heroism
case 57724: target->ApplySpellImmune(GetId(), IMMUNITY_ID, 2825, apply); break; // Bloodlust
@@ -5069,7 +5069,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
if (apply)
{
switch(m_spellInfo->Id)
switch (m_spellInfo->Id)
{
case 57819: FactionID = 1106; break; // Argent Crusade
case 57820: FactionID = 1098; break; // Knights of the Ebon Blade
@@ -5151,7 +5151,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
{
if (!(mode & AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK))
break;
switch(GetId())
switch (GetId())
{
case 52610: // Savage Roar
{
@@ -5608,8 +5608,8 @@ void AuraEffect::HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const
case 66149: // Bullet Controller Periodic - 10 Man
case 68396: // Bullet Controller Periodic - 25 Man
{
caster->CastCustomSpell(66152, SPELLVALUE_MAX_TARGETS, urand(1,6), target, true);
caster->CastCustomSpell(66153, SPELLVALUE_MAX_TARGETS, urand(1,6), target, true);
caster->CastCustomSpell(66152, SPELLVALUE_MAX_TARGETS, urand(1, 6), target, true);
caster->CastCustomSpell(66153, SPELLVALUE_MAX_TARGETS, urand(1, 6), target, true);
break;
}
case 54798: // FLAMING Arrow Triggered Effect
@@ -5979,7 +5979,7 @@ void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster)
}
case SPELLFAMILY_SHAMAN:
{
switch(auraId)
switch (auraId)
{
// Lightning Shield (The Earthshatterer set trigger after cast Lighting Shield)
case 28820:
@@ -6541,7 +6541,7 @@ void AuraEffect::HandlePeriodicManaLeechAuraTick(Unit* target, Unit* caster) con
}
// spell-specific code
switch(GetId())
switch (GetId())
{
case 31447: // Mark of Kaz'rogal
if (target->GetPower(powerType) == 0)
+25 -25
View File
@@ -57,7 +57,7 @@ m_effectsToApply(effMask), m_removeMode(AURA_REMOVE_NONE), m_needClientUpdate(fa
Unit::VisibleAuraMap const* visibleAuras = GetTarget()->GetVisibleAuras();
// lookup for free slots in units visibleAuras
Unit::VisibleAuraMap::const_iterator itr = visibleAuras->find(0);
for (uint32 freeSlot = 0; freeSlot < MAX_AURAS; ++itr , ++freeSlot)
for (uint32 freeSlot = 0; freeSlot < MAX_AURAS; ++itr, ++freeSlot)
{
if (itr == visibleAuras->end() || itr->first != freeSlot)
{
@@ -224,7 +224,7 @@ uint8 Aura::BuildEffectMaskForOwner(SpellInfo const* spellProto, uint8 avalibleE
ASSERT(spellProto);
ASSERT(owner);
uint8 effMask = 0;
switch(owner->GetTypeId())
switch (owner->GetTypeId())
{
case TYPEID_UNIT:
case TYPEID_PLAYER:
@@ -362,7 +362,7 @@ void Aura::_InitEffects(uint8 effMask, Unit* caster, int32 *baseAmount)
Aura::~Aura()
{
// unload scripts
while(!m_loadedScripts.empty())
while (!m_loadedScripts.empty())
{
std::list<AuraScript*>::iterator itr = m_loadedScripts.begin();
(*itr)->_Unload();
@@ -469,7 +469,7 @@ void Aura::UpdateTargetMap(Unit* caster, bool apply)
// fill up to date target list
// target, effMask
std::map<Unit* , uint8> targets;
std::map<Unit*, uint8> targets;
FillTargetMap(targets, caster);
@@ -478,7 +478,7 @@ void Aura::UpdateTargetMap(Unit* caster, bool apply)
// mark all auras as ready to remove
for (ApplicationMap::iterator appIter = m_applications.begin(); appIter != m_applications.end();++appIter)
{
std::map<Unit* , uint8>::iterator existing = targets.find(appIter->second->GetTarget());
std::map<Unit*, uint8>::iterator existing = targets.find(appIter->second->GetTarget());
// not found in current area - remove the aura
if (existing == targets.end())
targetsToRemove.push_back(appIter->second->GetTarget());
@@ -495,7 +495,7 @@ void Aura::UpdateTargetMap(Unit* caster, bool apply)
}
// register auras for units
for (std::map<Unit* , uint8>::iterator itr = targets.begin(); itr!= targets.end();)
for (std::map<Unit*, uint8>::iterator itr = targets.begin(); itr!= targets.end();)
{
// aura mustn't be already applied on target
if (AuraApplication * aurApp = GetApplicationOfTarget(itr->first->GetGUID()))
@@ -572,7 +572,7 @@ void Aura::UpdateTargetMap(Unit* caster, bool apply)
return;
// apply aura effects for units
for (std::map<Unit* , uint8>::iterator itr = targets.begin(); itr!= targets.end();++itr)
for (std::map<Unit*, uint8>::iterator itr = targets.begin(); itr!= targets.end();++itr)
{
if (AuraApplication * aurApp = GetApplicationOfTarget(itr->first->GetGUID()))
{
@@ -1091,7 +1091,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
switch (GetSpellInfo()->SpellFamilyName)
{
case SPELLFAMILY_GENERIC:
switch(GetId())
switch (GetId())
{
case 32474: // Buffeting Winds of Susurrus
if (target->GetTypeId() == TYPEID_PLAYER)
@@ -1153,7 +1153,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
caster->CastSpell(target, 61634, true);
}
}
switch(GetId())
switch (GetId())
{
case 12536: // Clearcasting
case 12043: // Presence of Mind
@@ -1190,7 +1190,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
}
break;
case SPELLFAMILY_WARLOCK:
switch(GetId())
switch (GetId())
{
case 48020: // Demonic Circle
if (target->GetTypeId() == TYPEID_PLAYER)
@@ -1294,10 +1294,10 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
// mods at aura remove
else
{
switch(GetSpellInfo()->SpellFamilyName)
switch (GetSpellInfo()->SpellFamilyName)
{
case SPELLFAMILY_GENERIC:
switch(GetId())
switch (GetId())
{
case 61987: // Avenging Wrath
// Remove the immunity shield marker on Avenging Wrath removal if Forbearance is not present
@@ -1319,7 +1319,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
}
break;
case SPELLFAMILY_MAGE:
switch(GetId())
switch (GetId())
{
case 66: // Invisibility
if (removeMode != AURA_REMOVE_BY_EXPIRE)
@@ -1403,7 +1403,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
caster->CastSpell(target, spellId, true);
}
}
switch(GetId())
switch (GetId())
{
case 48018: // Demonic Circle
// Do not remove GO when aura is removed by stack
@@ -1461,7 +1461,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
break;
int32 triggeredSpellId = 0;
switch(target->getPowerType())
switch (target->getPowerType())
{
case POWER_MANA:
{
@@ -1480,7 +1480,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
}
}
}
switch(GetId())
switch (GetId())
{
case 47788: // Guardian Spirit
if (removeMode != AURA_REMOVE_BY_EXPIRE)
@@ -1570,7 +1570,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
else
{
int32 basepoints0 = aurEff->GetAmount();
target->CastCustomSpell(target, 31665, &basepoints0, NULL, NULL , true);
target->CastCustomSpell(target, 31665, &basepoints0, NULL, NULL, true);
}
}
// Overkill
@@ -1585,7 +1585,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
}
break;
case SPELLFAMILY_HUNTER:
switch(GetId())
switch (GetId())
{
case 19574: // Bestial Wrath
// The Beast Within cast on owner if talent present
@@ -1604,7 +1604,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
}
break;
case SPELLFAMILY_PALADIN:
switch(GetId())
switch (GetId())
{
case 19746:
case 31821:
@@ -1646,7 +1646,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
Unit::AuraEffectList const& vDummyAuras = target->GetAuraEffectsByType(SPELL_AURA_DUMMY);
for (Unit::AuraEffectList::const_iterator itr = vDummyAuras.begin(); itr != vDummyAuras.end(); ++itr)
{
switch((*itr)->GetId())
switch ((*itr)->GetId())
{
// Improved Blood Presence
case 50365:
@@ -1698,7 +1698,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
{
// Not listed as any effect, only base points set
int32 basePoints0 = unholyPresenceAura->GetSpellInfo()->Effects[EFFECT_1].CalcValue();
target->CastCustomSpell(target, 63622, &basePoints0 , &basePoints0, &basePoints0, true, 0, unholyPresenceAura);
target->CastCustomSpell(target, 63622, &basePoints0, &basePoints0, &basePoints0, true, 0, unholyPresenceAura);
}
target->CastSpell(target, 49772, true);
}
@@ -2297,7 +2297,7 @@ void UnitAura::Remove(AuraRemoveMode removeMode)
GetUnitOwner()->RemoveOwnedAura(this, removeMode);
}
void UnitAura::FillTargetMap(std::map<Unit* , uint8> & targets, Unit* caster)
void UnitAura::FillTargetMap(std::map<Unit*, uint8> & targets, Unit* caster)
{
for (uint8 effIndex = 0; effIndex < MAX_SPELL_EFFECTS ; ++effIndex)
{
@@ -2355,7 +2355,7 @@ void UnitAura::FillTargetMap(std::map<Unit* , uint8> & targets, Unit* caster)
for (UnitList::iterator itr = targetList.begin(); itr!= targetList.end();++itr)
{
std::map<Unit* , uint8>::iterator existing = targets.find(*itr);
std::map<Unit*, uint8>::iterator existing = targets.find(*itr);
if (existing != targets.end())
existing->second |= 1<<effIndex;
else
@@ -2382,7 +2382,7 @@ void DynObjAura::Remove(AuraRemoveMode removeMode)
_Remove(removeMode);
}
void DynObjAura::FillTargetMap(std::map<Unit* , uint8> & targets, Unit* /*caster*/)
void DynObjAura::FillTargetMap(std::map<Unit*, uint8> & targets, Unit* /*caster*/)
{
Unit* dynObjOwnerCaster = GetDynobjOwner()->GetCaster();
float radius = GetDynobjOwner()->GetRadius();
@@ -2408,7 +2408,7 @@ void DynObjAura::FillTargetMap(std::map<Unit* , uint8> & targets, Unit* /*caster
for (UnitList::iterator itr = targetList.begin(); itr!= targetList.end();++itr)
{
std::map<Unit* , uint8>::iterator existing = targets.find(*itr);
std::map<Unit*, uint8>::iterator existing = targets.find(*itr);
if (existing != targets.end())
existing->second |= 1<<effIndex;
else
+3 -3
View File
@@ -112,7 +112,7 @@ class Aura
void _Remove(AuraRemoveMode removeMode);
virtual void Remove(AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT) = 0;
virtual void FillTargetMap(std::map<Unit* , uint8> & targets, Unit* caster) = 0;
virtual void FillTargetMap(std::map<Unit*, uint8> & targets, Unit* caster) = 0;
void UpdateTargetMap(Unit* caster, bool apply = true);
void _RegisterForTargets() {Unit* caster = GetCaster(); UpdateTargetMap(caster, false);}
@@ -252,7 +252,7 @@ class UnitAura : public Aura
void Remove(AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
void FillTargetMap(std::map<Unit* , uint8> & targets, Unit* caster);
void FillTargetMap(std::map<Unit*, uint8> & targets, Unit* caster);
// Allow Apply Aura Handler to modify and access m_AuraDRGroup
void SetDiminishGroup(DiminishingGroup group) { m_AuraDRGroup = group; }
@@ -270,6 +270,6 @@ class DynObjAura : public Aura
public:
void Remove(AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
void FillTargetMap(std::map<Unit* , uint8> & targets, Unit* caster);
void FillTargetMap(std::map<Unit*, uint8> & targets, Unit* caster);
};
#endif