diff options
author | Spp- <u84280@epreinf21.(none)> | 2011-07-27 11:00:39 +0200 |
---|---|---|
committer | Spp- <u84280@epreinf21.(none)> | 2011-07-27 11:00:39 +0200 |
commit | fa50c0a4646fd87da807130a043db2d89c022ccb (patch) | |
tree | 922e4e90a5adcf67e7b2e9194f588b0a01ecdbe3 /src/server/game/Spells/Spell.cpp | |
parent | 39be30a39f1a04d0d432ff74952110a44ef6abf6 (diff) |
Fix some warnings here and there
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
-rwxr-xr-x | src/server/game/Spells/Spell.cpp | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 7080d7629a9..751ab8d0393 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -1679,6 +1679,7 @@ bool Spell::UpdateChanneledTargetList() if (IsValidDeadOrAliveTarget(unit)) { if (channelAuraMask & ihit->effectMask) + { if (AuraApplication * aurApp = unit->GetAuraApplication(m_spellInfo->Id, m_originalCasterGUID)) { if (m_caster != unit && !m_caster->IsWithinDistInMap(unit, range)) @@ -1690,6 +1691,7 @@ bool Spell::UpdateChanneledTargetList() } else // aura is dispelled continue; + } channelTargetEffectMask &= ~ihit->effectMask; // remove from need alive mask effect that have alive target } @@ -2020,6 +2022,8 @@ void Spell::SelectEffectTargets(uint32 i, SpellImplicitTargetInfo const& cur) if (Unit *unit = m_caster->GetVehicleKit()->GetPassenger(cur - TARGET_UNIT_PASSENGER_0)) AddUnitTarget(unit, i); break; + default: + break; } break; } @@ -2068,6 +2072,8 @@ void Spell::SelectEffectTargets(uint32 i, SpellImplicitTargetInfo const& cur) case TARGET_UNIT_TARGET_CLASS_RAID: pushType = PUSH_CASTER_CENTER; // not real break; + default: + break; } break; } @@ -2097,6 +2103,8 @@ void Spell::SelectEffectTargets(uint32 i, SpellImplicitTargetInfo const& cur) if (modOwner) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RANGE, range, this); target = SearchNearbyTarget(range, SPELL_TARGETS_ENTRY, SpellEffIndex(i)); break; + default: + break; } if (!target) @@ -2302,6 +2310,8 @@ void Spell::SelectEffectTargets(uint32 i, SpellImplicitTargetInfo const& cur) m_targets.SetDst(*target); break; } + default: + break; } break; } @@ -2334,6 +2344,8 @@ void Spell::SelectEffectTargets(uint32 i, SpellImplicitTargetInfo const& cur) case TARGET_DEST_CHANNEL_CASTER: m_targets.SetDst(*m_originalCaster->GetCurrentSpell(CURRENT_CHANNELED_SPELL)->GetCaster()); break; + default: + break; } break; } @@ -2401,6 +2413,8 @@ void Spell::SelectEffectTargets(uint32 i, SpellImplicitTargetInfo const& cur) if (modOwner) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RANGE, range, this); SearchChainTarget(unitList, range, maxTargets, SPELL_TARGETS_CHAINHEAL); break; + default: + break; } CallScriptAfterUnitTargetSelectHandlers(unitList, SpellEffIndex(i)); @@ -2623,6 +2637,8 @@ void Spell::SelectEffectTargets(uint32 i, SpellImplicitTargetInfo const& cur) AddUnitTarget(m_targets.GetUnitTarget(), i); break; } + default: + break; } break; } @@ -4420,20 +4436,15 @@ SpellCastResult Spell::CheckRuneCost(uint32 runeCostID) void Spell::TakeRunePower(bool didHit) { - if (m_caster->GetTypeId() != TYPEID_PLAYER) - return; - - Player* player = m_caster->ToPlayer(); - - if (player->getClass() != CLASS_DEATH_KNIGHT) + if (m_caster->GetTypeId() != TYPEID_PLAYER || m_caster->getClass() != CLASS_DEATH_KNIGHT) return; SpellRuneCostEntry const *runeCostData = sSpellRuneCostStore.LookupEntry(m_spellInfo->RuneCostID); - if (!runeCostData || (runeCostData->NoRuneCost() && runeCostData->NoRunicPowerGain())) return; - m_runesState = player->GetRunesState(); // store previous state + Player *player = m_caster->ToPlayer(); + m_runesState = player->GetRunesState(); // store previous state int32 runeCost[NUM_RUNE_TYPES]; // blood, frost, unholy, death @@ -4451,7 +4462,7 @@ void Spell::TakeRunePower(bool didHit) RuneType rune = player->GetCurrentRune(i); if (!player->GetRuneCooldown(i) && runeCost[rune] > 0) { - player->SetRuneCooldown(i, didHit ? player->GetRuneBaseCooldown(i) : RUNE_MISS_COOLDOWN); + player->SetRuneCooldown(i, didHit ? player->GetRuneBaseCooldown(i) : uint32(RUNE_MISS_COOLDOWN)); player->SetLastUsedRune(rune); runeCost[rune]--; } @@ -4466,7 +4477,7 @@ void Spell::TakeRunePower(bool didHit) RuneType rune = player->GetCurrentRune(i); if (!player->GetRuneCooldown(i) && rune == RUNE_DEATH) { - player->SetRuneCooldown(i, didHit ? player->GetRuneBaseCooldown(i) : RUNE_MISS_COOLDOWN); + player->SetRuneCooldown(i, didHit ? player->GetRuneBaseCooldown(i) : uint32(RUNE_MISS_COOLDOWN)); player->SetLastUsedRune(rune); runeCost[rune]--; |