diff options
author | QAston <none@none> | 2009-02-21 20:23:13 +0100 |
---|---|---|
committer | QAston <none@none> | 2009-02-21 20:23:13 +0100 |
commit | c3c387f27ed5950e46c68bb1511ae4de41b982fe (patch) | |
tree | 3cf49321f1ee54d756c9834e04a7d629a2b4d4bc /src | |
parent | a0c920265d39b799458bb5369dd14a40fbc24c35 (diff) |
*Fix crash in latest rev.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Unit.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 0fb76244bdb..f58a3d63f16 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -11978,9 +11978,6 @@ bool Unit::HandleAuraRaidProcFromChargeWithValue( Aura* triggeredByAura ) // current aura expire triggeredByAura->SetAuraCharges(1); // will removed at next charges decrease - //Get max possible jumps for aura to get proper charges amount for target - int32 maxJumps = spellProto->procCharges; - // next target selection if(jumps > 0 && IS_PLAYER_GUID(caster_guid)) { @@ -11990,6 +11987,9 @@ bool Unit::HandleAuraRaidProcFromChargeWithValue( Aura* triggeredByAura ) else radius = GetSpellMaxRangeForTarget(triggeredByAura->GetCaster() ,sSpellRangeStore.LookupEntry(spellProto->rangeIndex)); + //Get max possible jumps for aura to get proper charges amount for target + int32 maxJumps = spellProto->procCharges; + if(Player* caster = ((Player*)triggeredByAura->GetCaster())) { caster->ApplySpellMod(spellProto->Id, SPELLMOD_RADIUS, radius,NULL); @@ -12001,8 +12001,8 @@ bool Unit::HandleAuraRaidProcFromChargeWithValue( Aura* triggeredByAura ) player = (Player*)this; else if (GetTypeId() == TYPEID_UNIT && ((Creature*)this)->isPet()) player=(Player*)GetOwner(); - - if (Player* target = player->GetNextRandomRaidMember(radius)) + Player* target= player ? player->GetNextRandomRaidMember(radius): NULL; + if (target) { // aura will applied from caster, but spell casted from current aura holder SpellModifier *mod = new SpellModifier; @@ -12058,9 +12058,6 @@ bool Unit::HandleAuraRaidProcFromCharge( Aura* triggeredByAura ) // current aura expire triggeredByAura->SetAuraCharges(1); // will removed at next charges decrease - //Get max possible jumps for aura to get proper charges amount for target - int32 maxJumps = spellProto->procCharges; - // next target selection if(jumps > 0 && IS_PLAYER_GUID(caster_guid)) { @@ -12070,6 +12067,9 @@ bool Unit::HandleAuraRaidProcFromCharge( Aura* triggeredByAura ) else radius = GetSpellMaxRangeForTarget(triggeredByAura->GetCaster() ,sSpellRangeStore.LookupEntry(spellProto->rangeIndex)); + //Get max possible jumps for aura to get proper charges amount for target + int32 maxJumps = spellProto->procCharges; + if(Player* caster = ((Player*)triggeredByAura->GetCaster())) { caster->ApplySpellMod(spellProto->Id, SPELLMOD_RADIUS, radius,NULL); @@ -12081,8 +12081,8 @@ bool Unit::HandleAuraRaidProcFromCharge( Aura* triggeredByAura ) player = (Player*)this; else if (GetTypeId() == TYPEID_UNIT && ((Creature*)this)->isPet()) player=(Player*)GetOwner(); - - if (Player* target = player->GetNextRandomRaidMember(radius)) + Player* target= player ? player->GetNextRandomRaidMember(radius): NULL; + if (target) { // aura will applied from caster, but spell casted from current aura holder SpellModifier *mod = new SpellModifier; |