diff options
| author | Shauren <shauren.trinity@gmail.com> | 2011-11-23 19:17:33 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2011-11-23 19:17:33 +0100 |
| commit | 358b33239aea4e7b5b81f829e0b0079e3ab03830 (patch) | |
| tree | 1d18bf9c3269a826dc82dc2542a050068aa3ac88 /src/server/game/Entities/Unit | |
| parent | f091360940322c5b674c93e80b59af66881f9953 (diff) | |
Core: Fixed remaining C6246: Local declaration of 'x' hides declaration of the same name in outer scope. from previous commit
Diffstat (limited to 'src/server/game/Entities/Unit')
| -rwxr-xr-x | src/server/game/Entities/Unit/Unit.cpp | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index b99ccd5f35f..54686fda0ed 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1514,8 +1514,8 @@ uint32 Unit::CalcArmorReducedDamage(Unit* victim, const uint32 damage, SpellInfo if (GetTypeId() == TYPEID_PLAYER) { - AuraEffectList const& ResIgnoreAuras = GetAuraEffectsByType(SPELL_AURA_MOD_ARMOR_PENETRATION_PCT); - for (AuraEffectList::const_iterator itr = ResIgnoreAuras.begin(); itr != ResIgnoreAuras.end(); ++itr) + AuraEffectList const& ArPenAuras = GetAuraEffectsByType(SPELL_AURA_MOD_ARMOR_PENETRATION_PCT); + for (AuraEffectList::const_iterator itr = ArPenAuras.begin(); itr != ArPenAuras.end(); ++itr) { // item neutral spell if ((*itr)->GetSpellInfo()->EquippedItemClass == -1) @@ -1687,12 +1687,12 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe if (currentAbsorb < 0) currentAbsorb = 0; - uint32 absorb = currentAbsorb; + uint32 tempAbsorb = uint32(currentAbsorb); bool defaultPrevented = false; - absorbAurEff->GetBase()->CallScriptEffectAbsorbHandlers(absorbAurEff, aurApp, dmgInfo, absorb, defaultPrevented); - currentAbsorb = absorb; + absorbAurEff->GetBase()->CallScriptEffectAbsorbHandlers(absorbAurEff, aurApp, dmgInfo, tempAbsorb, defaultPrevented); + currentAbsorb = tempAbsorb; if (defaultPrevented) continue; @@ -1705,8 +1705,8 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe dmgInfo.AbsorbDamage(currentAbsorb); - absorb = currentAbsorb; - absorbAurEff->GetBase()->CallScriptEffectAfterAbsorbHandlers(absorbAurEff, aurApp, dmgInfo, absorb); + tempAbsorb = currentAbsorb; + absorbAurEff->GetBase()->CallScriptEffectAfterAbsorbHandlers(absorbAurEff, aurApp, dmgInfo, tempAbsorb); // Check if our aura is using amount to count damage if (absorbAurEff->GetAmount() >= 0) @@ -1738,12 +1738,12 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe if (currentAbsorb < 0) currentAbsorb = 0; - uint32 absorb = currentAbsorb; + uint32 tempAbsorb = currentAbsorb; bool defaultPrevented = false; - absorbAurEff->GetBase()->CallScriptEffectManaShieldHandlers(absorbAurEff, aurApp, dmgInfo, absorb, defaultPrevented); - currentAbsorb = absorb; + absorbAurEff->GetBase()->CallScriptEffectManaShieldHandlers(absorbAurEff, aurApp, dmgInfo, tempAbsorb, defaultPrevented); + currentAbsorb = tempAbsorb; if (defaultPrevented) continue; @@ -1766,8 +1766,8 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe dmgInfo.AbsorbDamage(currentAbsorb); - absorb = currentAbsorb; - absorbAurEff->GetBase()->CallScriptEffectAfterManaShieldHandlers(absorbAurEff, aurApp, dmgInfo, absorb); + tempAbsorb = currentAbsorb; + absorbAurEff->GetBase()->CallScriptEffectAfterManaShieldHandlers(absorbAurEff, aurApp, dmgInfo, tempAbsorb); // Check if our aura is using amount to count damage if (absorbAurEff->GetAmount() >= 0) @@ -3744,13 +3744,13 @@ void Unit::RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit* // Cast duration to unsigned to prevent permanent aura's such as Righteous Fury being permanently added to caster uint32 dur = std::min(2u * MINUTE * IN_MILLISECONDS, uint32(aura->GetDuration())); - if (Aura* newAura = stealer->GetAura(aura->GetId(), aura->GetCasterGUID())) + if (Aura* oldAura = stealer->GetAura(aura->GetId(), aura->GetCasterGUID())) { if (stealCharge) - newAura->ModCharges(1); + oldAura->ModCharges(1); else - newAura->ModStackAmount(1); - newAura->SetDuration(int32(dur)); + oldAura->ModStackAmount(1); + oldAura->SetDuration(int32(dur)); } else { @@ -5242,7 +5242,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere break; case CLASS_ROGUE: // 39511, 40997, 40998, 41002, 41005, 41011 case CLASS_WARRIOR: // 39511, 40997, 40998, 41002, 41005, 41011 - case CLASS_DEATH_KNIGHT: + case CLASS_DEATH_KNIGHT: triggered_spell_id = RAND(39511, 40997, 40998, 41002, 41005, 41011); cooldown_spell_id = 39511; break; @@ -11970,7 +11970,7 @@ void Unit::Unmount() if (GetTypeId() == TYPEID_PLAYER && GetVehicleKit()) { // Send other players that we are no longer a vehicle - WorldPacket data(SMSG_PLAYER_VEHICLE_DATA, 8+4); + data.Initialize(SMSG_PLAYER_VEHICLE_DATA, 8+4); data.appendPackGUID(GetGUID()); data << uint32(0); ToPlayer()->SendMessageToSet(&data, true); @@ -14378,8 +14378,8 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: doing %u damage from spell id %u (triggered by %s aura of spell %u)", triggeredByAura->GetAmount(), spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); SpellNonMeleeDamage damageInfo(this, target, spellInfo->Id, spellInfo->SchoolMask); - uint32 damage = SpellDamageBonus(target, spellInfo, triggeredByAura->GetAmount(), SPELL_DIRECT_DAMAGE); - CalculateSpellDamageTaken(&damageInfo, damage, spellInfo); + uint32 newDamage = SpellDamageBonus(target, spellInfo, triggeredByAura->GetAmount(), SPELL_DIRECT_DAMAGE); + CalculateSpellDamageTaken(&damageInfo, newDamage, spellInfo); DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb); SendSpellNonMeleeDamageLog(&damageInfo); DealSpellDamage(&damageInfo, true); @@ -16589,10 +16589,9 @@ float Unit::GetCombatRatingReduction(CombatRating cr) const if (Player const* player = ToPlayer()) return player->GetRatingBonusValue(cr); // Player's pet get resilience from owner - else if (isPet()) - if (Unit* owner = GetOwner()) - if (Player* player = owner->ToPlayer()) - return player->GetRatingBonusValue(cr); + else if (isPet() && GetOwner()) + if (Player* owner = GetOwner()->ToPlayer()) + return owner->GetRatingBonusValue(cr); return 0.0f; } |
