Core/Commands: Fix .cheat kill and add instakill immunity to it
Closes #7586
This commit is contained in:
@@ -541,6 +541,10 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam
|
||||
if (IsAIEnabled)
|
||||
GetAI()->DamageDealt(victim, damage, damagetype);
|
||||
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
if (victim->ToPlayer()->GetCommandStatus(CHEAT_GOD))
|
||||
return 0;
|
||||
|
||||
// Signal to pets that their owner was attacked
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
|
||||
@@ -277,6 +277,10 @@ void Spell::EffectInstaKill(SpellEffIndex /*effIndex*/)
|
||||
if (!unitTarget || !unitTarget->isAlive())
|
||||
return;
|
||||
|
||||
if (unitTarget->GetTypeId() == TYPEID_PLAYER)
|
||||
if (unitTarget->ToPlayer()->GetCommandStatus(CHEAT_GOD))
|
||||
return;
|
||||
|
||||
if (m_caster == unitTarget) // prevent interrupt message
|
||||
finish();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user