*Prevent possible crash.

*Remove obsolete Judgement of Righteousness coefficient-by cccyril

--HG--
branch : trunk
This commit is contained in:
QAston
2009-03-15 18:02:10 +01:00
parent f9b14c221b
commit 7a1e7c4f73
5 changed files with 16 additions and 17 deletions
+2
View File
@@ -19286,6 +19286,8 @@ void Player::SendAurasForTarget(Unit *target)
{ {
if (Unit * caster = aura->GetCaster()) if (Unit * caster = aura->GetCaster())
data.append(caster->GetPackGUID()); data.append(caster->GetPackGUID());
else
data << uint8(0);
} }
if(itr->second.m_Flags & AFLAG_DURATION) // include aura duration if(itr->second.m_Flags & AFLAG_DURATION) // include aura duration
+10 -8
View File
@@ -831,6 +831,8 @@ void Aura::_AddAura()
Unit::VisibleAuraMap const *visibleAuras = m_target->GetVisibleAuras(); Unit::VisibleAuraMap const *visibleAuras = m_target->GetVisibleAuras();
if(visibleAuras->size() < MAX_AURAS || slot < MAX_AURAS) // got free slot if(visibleAuras->size() < MAX_AURAS || slot < MAX_AURAS) // got free slot
{ {
AuraSlotEntry * entry;
// Lookup free slot // Lookup free slot
if (!secondaura) if (!secondaura)
{ {
@@ -845,18 +847,18 @@ void Aura::_AddAura()
} }
assert(slot < MAX_AURAS); // assert that we find a slot and it is valid assert(slot < MAX_AURAS); // assert that we find a slot and it is valid
AuraSlotEntry t_entry; entry = m_target->GetVisibleAuraSlot(slot);
t_entry.m_Flags=(IsPositive() ? AFLAG_POSITIVE : AFLAG_NEGATIVE) | ((GetCasterGUID() == m_target->GetGUID()) ? AFLAG_CASTER : AFLAG_NONE) | ((GetAuraMaxDuration() > 0) ? AFLAG_DURATION : AFLAG_NONE); 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)); entry->m_Level=(caster ? caster->getLevel() : sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL));
t_entry.m_spellId = GetId(); entry->m_spellId = GetId();
//init pointers-prevent unexpected behaviour //init pointers-prevent unexpected behaviour
for(uint8 i = 0; i < 3; i++) for(uint8 i = 0; i < 3; i++)
t_entry.m_slotAuras[i]=NULL; entry->m_slotAuras[i]=NULL;
m_target->SetVisibleAura(slot, t_entry);
} }
else
entry = m_target->GetVisibleAura(slot);
if(AuraSlotEntry *entry = m_target->GetVisibleAura(slot)) if(entry)
{ {
entry->m_Flags |= (1 << GetEffIndex()); entry->m_Flags |= (1 << GetEffIndex());
entry->m_slotAuras[GetEffIndex()]=this; entry->m_slotAuras[GetEffIndex()]=this;
-8
View File
@@ -1682,14 +1682,6 @@ void Spell::EffectDummy(uint32 i)
switch(m_spellInfo->Id) 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) case 31789: // Righteous Defense (step 1)
{ {
// 31989 -> dummy effect (step 1) + dummy effect (step 2) -> 31709 (taunt like spell for each target) // 31989 -> dummy effect (step 1) + dummy effect (step 2) -> 31709 (taunt like spell for each target)
+3
View File
@@ -6099,6 +6099,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case 20186: case 20186:
{ {
pVictim->CastSpell(pVictim, 20268, true, NULL, triggeredByAura); pVictim->CastSpell(pVictim, 20268, true, NULL, triggeredByAura);
return true;
} }
// Holy Power (Redemption Armor set) // Holy Power (Redemption Armor set)
case 28789: case 28789:
@@ -13423,6 +13424,8 @@ void Unit::SendAuraUpdate(uint8 slot)
{ {
if (Unit * caster = ptr->GetCaster()) if (Unit * caster = ptr->GetCaster())
data.append(caster->GetPackGUID()); data.append(caster->GetPackGUID());
else
data << uint8(0);
} }
if(entry->m_Flags & AFLAG_DURATION) if(entry->m_Flags & AFLAG_DURATION)
+1 -1
View File
@@ -1384,7 +1384,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
return &itr->second; return &itr->second;
return 0; 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); } void RemoveVisibleAura(uint8 slot) { m_visibleAuras.erase(slot); }
const uint64& GetAuraUpdateMask() const { return m_auraUpdateMask; } const uint64& GetAuraUpdateMask() const { return m_auraUpdateMask; }