Misc: replace Unit::GetPlayer with ObjectAccessor::GetPlayer and some cosmetic changes
This commit is contained in:
1 parent
c32dbd1432
commit
2b19ba1879
37 files changed
+263
-300
No files matched your search
@@ -2526,10 +2526,7 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit* victim, SpellInfo const* spellInfo
|
||||
// Increase hit chance from attacker SPELL_AURA_MOD_SPELL_HIT_CHANCE and attacker ratings
|
||||
HitChance += int32(m_modSpellHitChance * 100.0f);
|
||||
|
||||
if (HitChance < 100)
|
||||
HitChance = 100;
|
||||
else if (HitChance > 10000)
|
||||
HitChance = 10000;
|
||||
RoundToInterval(HitChance, 100, 10000);
|
||||
|
||||
int32 tmp = 10000 - HitChance;
|
||||
|
||||
@@ -5741,8 +5738,8 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
// if damage is more than need or target die from damage deal finish spell
|
||||
if (triggeredByAura->GetAmount() <= int32(damage) || GetHealth() <= damage)
|
||||
{
|
||||
// remember guid before aura delete
|
||||
uint64 casterGuid = triggeredByAura->GetCasterGUID();
|
||||
// remember caster before aura delete
|
||||
Unit* caster = triggeredByAura->GetCaster();
|
||||
|
||||
// Remove aura (before cast for prevent infinite loop handlers)
|
||||
RemoveAurasDueToSpell(triggeredByAura->GetId());
|
||||
@@ -5750,7 +5747,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
uint32 spell = sSpellMgr->GetSpellWithRank(27285, dummySpell->GetRank());
|
||||
|
||||
// Cast finish spell (triggeredByAura already not exist!)
|
||||
if (Unit* caster = GetUnit(*this, casterGuid))
|
||||
if (caster)
|
||||
caster->CastSpell(this, spell, true, castItem);
|
||||
return true; // no hidden cooldown
|
||||
}
|
||||
@@ -5765,14 +5762,14 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
// if damage is more than need deal finish spell
|
||||
if (triggeredByAura->GetAmount() <= int32(damage))
|
||||
{
|
||||
// remember guid before aura delete
|
||||
uint64 casterGuid = triggeredByAura->GetCasterGUID();
|
||||
// remember caster before aura delete
|
||||
Unit* caster = triggeredByAura->GetCaster();
|
||||
|
||||
// Remove aura (before cast for prevent infinite loop handlers)
|
||||
RemoveAurasDueToSpell(triggeredByAura->GetId());
|
||||
|
||||
// Cast finish spell (triggeredByAura already not exist!)
|
||||
if (Unit* caster = GetUnit(*this, casterGuid))
|
||||
if (caster)
|
||||
caster->CastSpell(this, 32865, true, castItem);
|
||||
return true; // no hidden cooldown
|
||||
}
|
||||
@@ -15933,7 +15930,7 @@ void Unit::RestoreFaction()
|
||||
|
||||
Unit* Unit::GetRedirectThreatTarget()
|
||||
{
|
||||
return _redirectThreadInfo.GetTargetGUID() ? GetUnit(*this, _redirectThreadInfo.GetTargetGUID()) : NULL;
|
||||
return _redirectThreadInfo.GetTargetGUID() ? ObjectAccessor::GetUnit(*this, _redirectThreadInfo.GetTargetGUID()) : NULL;
|
||||
}
|
||||
|
||||
bool Unit::CreateVehicleKit(uint32 id, uint32 creatureEntry)
|
||||
|
||||
Reference in new issue
Block a user