diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index b86517f444..f5b287b0b5 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -3020,7 +3020,7 @@ bool WorldObject::IsValidAttackTarget(WorldObject const* target, SpellInfo const { Player const* player = playerAffectingAttacker ? playerAffectingAttacker : playerAffectingTarget; - if (Unit const* creature = playerAffectingAttacker ? target->ToUnit() : ToUnit()) + if (Unit const* creature = playerAffectingAttacker ? unitTarget : unit) { if (creature->IsContestedGuard() && player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP)) return true; @@ -3040,7 +3040,6 @@ bool WorldObject::IsValidAttackTarget(WorldObject const* target, SpellInfo const if (creatureAttacker && (creatureAttacker->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT)) return false; - if (playerAffectingAttacker && playerAffectingTarget) if (playerAffectingAttacker->duel && playerAffectingAttacker->duel->opponent == playerAffectingTarget && playerAffectingAttacker->duel->startTime != 0) return true; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 94eac794d9..43ca880c36 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -3141,7 +3141,7 @@ AuraApplication* Unit::_CreateAuraApplication(Aura* aura, uint8 effMask) // this can happen if OnEffectHitTarget() script hook killed the unit or the aura owner (which can be different) if (aura->IsRemoved()) { - TC_LOG_ERROR("spells", "Unit::_CreateAuraApplication() called with a removed aura. Check if OnEffectHitTarget() is triggering any spell with apply aura effect (that's not allowed!)\nUnit: %s\nAura: %s", GetDebugInfo().c_str(), aura->GetDebugInfo().c_str()); + TC_LOG_ERROR("spells", "Unit::_CreateAuraApplication() called with a removed aura. Check if OnEffectHitTarget() is triggering any spell with apply aura effect (that's not allowed!)"); return nullptr; } diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 6ebb377a11..42e265213e 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3009,6 +3009,9 @@ void Spell::DoSpellEffectHit(Unit* unit, uint8 effIndex, TargetInfo& hitInfo) hitInfo.HitAura->SetDuration(hitInfo.AuraDuration); } + if (refresh) + hitInfo.HitAura->AddStaticApplication(unit, aura_effmask); + if (DynamicObject* dynObj = m_originalCaster->GetDynObject(m_spellInfo->Id)) dynObj->SetDuration(hitInfo.AuraDuration);