aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authorSpp <none@none>2010-04-19 17:03:10 +0200
committerSpp <none@none>2010-04-19 17:03:10 +0200
commitbe01821050dd30ff65e89b347d528efb20aba028 (patch)
tree6d33e686bf1c5d664a7104a208a4e057c6337b1e /src/game/Unit.cpp
parentf74e969a069646eca6227bdede974223c07e9c94 (diff)
More warning removal (Some code modifications and cleanup when needed)
--HG-- branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 397a6ffccc5..566112eacd3 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -3631,8 +3631,8 @@ void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMo
}
bool auraStateFound = false;
- AuraState auraState;
- if (auraState = GetSpellAuraState(aura->GetSpellProto()))
+ AuraState auraState = GetSpellAuraState(aura->GetSpellProto());
+ if (auraState)
{
bool canBreak = false;
// Get mask of all aurastates from remaining auras
@@ -5950,7 +5950,8 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
if ((*i)->GetEffIndex() != 0)
continue;
basepoints0 = int32((*i)->GetAmount());
- if (target = GetGuardianPet())
+ target = GetGuardianPet();
+ if (target)
{
// regen mana for pet
CastCustomSpell(target,54607,&basepoints0,NULL,NULL,true,castItem,triggeredByAura);
@@ -12111,10 +12112,10 @@ Unit* Creature::SelectVictim()
const AuraEffectList& tauntAuras = GetAuraEffectsByType(SPELL_AURA_MOD_TAUNT);
if (!tauntAuras.empty())
{
- Unit* caster;
+ Unit* caster = tauntAuras.back()->GetCaster();
// The last taunt aura caster is alive an we are happy to attack him
- if ((caster = tauntAuras.back()->GetCaster()) && caster->isAlive())
+ if (caster && caster->isAlive())
return getVictim();
else if (tauntAuras.size() > 1)
{
@@ -12126,8 +12127,8 @@ Unit* Creature::SelectVictim()
do
{
--aura;
- if ((caster = (*aura)->GetCaster()) &&
- caster->IsInMap(this) && canAttack(caster) && caster->isInAccessiblePlaceFor(this->ToCreature()))
+ caster = (*aura)->GetCaster();
+ if (caster && caster->IsInMap(this) && canAttack(caster) && caster->isInAccessiblePlaceFor(this->ToCreature()))
{
target = caster;
break;
@@ -12194,9 +12195,11 @@ Unit* Creature::SelectVictim()
// search nearby enemy before enter evade mode
if (HasReactState(REACT_AGGRESSIVE))
- if (target = SelectNearestTarget())
- if (_IsTargetAcceptable(target))
+ {
+ target = SelectNearestTarget();
+ if (target && _IsTargetAcceptable(target))
return target;
+ }
if (m_invisibilityMask)
{
@@ -13221,7 +13224,7 @@ void CharmInfo::InitCharmCreateSpells()
{
m_charmspells[x].SetActionAndType(spellId,ACT_DISABLED);
- ActiveStates newstate;
+ ActiveStates newstate = ACT_PASSIVE;
if (spellInfo)
{
if (!IsAutocastableSpell(spellId))