mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
Core/Misc: don't allow players to use/activate/loot non-allowed gameobjects while under the effect of a damage immunity aura (#23319)
* Core/Misc: don't allow players to use/activate/loot non-allowed gameobjects while under the effect of a damage immunity aura. * Forgot to change this in last-second rename. * Apply suggested changes, thanks Shauren! # Conflicts: # src/server/game/Entities/GameObject/GameObject.cpp # src/server/game/Entities/Unit/UnitDefines.h # src/server/game/Entities/Unit/enuminfo_UnitDefines.cpp # src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_ahune.cpp
This commit is contained in:
@@ -5402,6 +5402,13 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint
|
||||
if (!m_caster->IsAlive() && !m_spellInfo->IsPassive() && !(m_spellInfo->HasAttribute(SPELL_ATTR0_CASTABLE_WHILE_DEAD) || (IsTriggered() && !m_triggeredByAuraSpell)))
|
||||
return SPELL_FAILED_CASTER_DEAD;
|
||||
|
||||
// Prevent cheating in case the player has an immunity effect and tries to interact with a non-allowed gameobject. The error message is handled by the client so we don't report anything here
|
||||
if (m_caster->ToPlayer() && m_targets.GetGOTarget())
|
||||
{
|
||||
if (m_targets.GetGOTarget()->GetGOInfo()->CannotBeUsedUnderImmunity() && m_caster->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE))
|
||||
return SPELL_FAILED_DONT_REPORT;
|
||||
}
|
||||
|
||||
// check cooldowns to prevent cheating
|
||||
if (!m_spellInfo->IsPassive())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user