aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQAston <none@none>2009-03-15 18:02:10 +0100
committerQAston <none@none>2009-03-15 18:02:10 +0100
commit7a1e7c4f73db8374aadfdd9a397a52549e09e90a (patch)
tree4ceb605871d629a9f9d24443520ee4b91d30e50f
parentf9b14c221bef52313ed9f8ec1802af507b770a69 (diff)
*Prevent possible crash.
*Remove obsolete Judgement of Righteousness coefficient-by cccyril --HG-- branch : trunk
-rw-r--r--src/game/Player.cpp2
-rw-r--r--src/game/SpellAuras.cpp18
-rw-r--r--src/game/SpellEffects.cpp8
-rw-r--r--src/game/Unit.cpp3
-rw-r--r--src/game/Unit.h2
5 files changed, 16 insertions, 17 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index a7828439383..9129aabf835 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -19286,6 +19286,8 @@ void Player::SendAurasForTarget(Unit *target)
{
if (Unit * caster = aura->GetCaster())
data.append(caster->GetPackGUID());
+ else
+ data << uint8(0);
}
if(itr->second.m_Flags & AFLAG_DURATION) // include aura duration
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index c0cf9d17b0e..b0c0b67b54a 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -831,6 +831,8 @@ void Aura::_AddAura()
Unit::VisibleAuraMap const *visibleAuras = m_target->GetVisibleAuras();
if(visibleAuras->size() < MAX_AURAS || slot < MAX_AURAS) // got free slot
{
+ AuraSlotEntry * entry;
+
// Lookup free slot
if (!secondaura)
{
@@ -845,18 +847,18 @@ void Aura::_AddAura()
}
assert(slot < MAX_AURAS); // assert that we find a slot and it is valid
- AuraSlotEntry t_entry;
- t_entry.m_Flags=(IsPositive() ? AFLAG_POSITIVE : AFLAG_NEGATIVE) | ((GetCasterGUID() == m_target->GetGUID()) ? AFLAG_CASTER : AFLAG_NONE) | ((GetAuraMaxDuration() > 0) ? AFLAG_DURATION : AFLAG_NONE);
- t_entry.m_Level=(caster ? caster->getLevel() : sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL));
- t_entry.m_spellId = GetId();
+ entry = m_target->GetVisibleAuraSlot(slot);
+ entry->m_Flags=(IsPositive() ? AFLAG_POSITIVE : AFLAG_NEGATIVE) | ((GetCasterGUID() == m_target->GetGUID()) ? AFLAG_CASTER : AFLAG_NONE) | ((GetAuraMaxDuration() > 0) ? AFLAG_DURATION : AFLAG_NONE);
+ entry->m_Level=(caster ? caster->getLevel() : sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL));
+ entry->m_spellId = GetId();
//init pointers-prevent unexpected behaviour
for(uint8 i = 0; i < 3; i++)
- t_entry.m_slotAuras[i]=NULL;
-
- m_target->SetVisibleAura(slot, t_entry);
+ entry->m_slotAuras[i]=NULL;
}
+ else
+ entry = m_target->GetVisibleAura(slot);
- if(AuraSlotEntry *entry = m_target->GetVisibleAura(slot))
+ if(entry)
{
entry->m_Flags |= (1 << GetEffIndex());
entry->m_slotAuras[GetEffIndex()]=this;
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 331e1ea3fe9..f51c83ef441 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -1682,14 +1682,6 @@ void Spell::EffectDummy(uint32 i)
switch(m_spellInfo->Id)
{
- // Judgement of Righteousness (0.2*$AP+0.32*$SPH) holy added in spellDamagBonus
- case 20187:
- {
- if (!unitTarget)
- return;
- m_damage+=int32(0.2f*m_caster->GetTotalAttackPowerValue(BASE_ATTACK));
- return;
- }
case 31789: // Righteous Defense (step 1)
{
// 31989 -> dummy effect (step 1) + dummy effect (step 2) -> 31709 (taunt like spell for each target)
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 6ac2b5cc865..3901c5b44fb 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -6099,6 +6099,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case 20186:
{
pVictim->CastSpell(pVictim, 20268, true, NULL, triggeredByAura);
+ return true;
}
// Holy Power (Redemption Armor set)
case 28789:
@@ -13423,6 +13424,8 @@ void Unit::SendAuraUpdate(uint8 slot)
{
if (Unit * caster = ptr->GetCaster())
data.append(caster->GetPackGUID());
+ else
+ data << uint8(0);
}
if(entry->m_Flags & AFLAG_DURATION)
diff --git a/src/game/Unit.h b/src/game/Unit.h
index c53da84acd1..c3b786f2715 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -1384,7 +1384,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
return &itr->second;
return 0;
}
- void SetVisibleAura(uint8 slot, AuraSlotEntry entry) { m_visibleAuras[slot] = entry; }
+ AuraSlotEntry * GetVisibleAuraSlot(uint8 slot) { return &m_visibleAuras[slot]; }
void RemoveVisibleAura(uint8 slot) { m_visibleAuras.erase(slot); }
const uint64& GetAuraUpdateMask() const { return m_auraUpdateMask; }