diff options
| author | Vincent-Michael <Vincent_Michael@gmx.de> | 2014-06-19 15:58:06 +0200 |
|---|---|---|
| committer | Vincent-Michael <Vincent_Michael@gmx.de> | 2014-06-19 15:58:33 +0200 |
| commit | 316d9a5ce89b1a21a22b4ef038d9c76e91e0e948 (patch) | |
| tree | 97ef3e8e9d52ccd3974efa0ce32e581622fe025b | |
| parent | fccdba38420a8818a4ffd8fde51dbc2a1dfb18a5 (diff) | |
Core/Misc: Fix coverity analysis issues
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 8a3bc282d4a..36d8d25ba8f 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -3845,6 +3845,8 @@ void Unit::RemoveAurasByType(AuraType auraType, uint64 casterGUID, Aura* except, { Aura* aura = (*iter)->GetBase(); AuraApplication * aurApp = aura->GetApplicationOfTarget(GetGUID()); + if (!aurApp) + continue; ++iter; if (aura != except && (!casterGUID || aura->GetCasterGUID() == casterGUID) @@ -10504,17 +10506,21 @@ float Unit::GetUnitSpellCriticalChance(Unit* victim, SpellInfo const* spellProto { if (!((*i)->IsAffectedOnSpell(spellProto))) continue; - int32 modChance = 0; + switch ((*i)->GetMiscValue()) { - // Shatter - case 911: modChance+= 16; - case 910: modChance+= 17; - case 849: modChance+= 17; - if (!victim->HasAuraState(AURA_STATE_FROZEN, spellProto, this)) - break; - crit_chance+=modChance; + case 911: // Shatter (Rank 1) + if (victim->HasAuraState(AURA_STATE_FROZEN, spellProto, this)) + crit_chance += 17; break; + case 910: // Shatter (Rank 2) + if (victim->HasAuraState(AURA_STATE_FROZEN, spellProto, this)) + crit_chance += 34; + break; + case 849: // Shatter (Rank 3) + if (victim->HasAuraState(AURA_STATE_FROZEN, spellProto, this)) + crit_chance += 50; + break; case 7917: // Glyph of Shadowburn if (victim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, spellProto, this)) crit_chance+=(*i)->GetAmount(); |
