*Fix crash in latest rev.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-02-21 20:23:13 +01:00
parent a0c920265d
commit c3c387f27e

View File

@@ -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;