Core/Commands: Fix .cheat kill and add instakill immunity to it

Closes #7586
This commit is contained in:
Myran2
2012-09-01 00:36:26 +01:00
committed by Nay
parent 107bd5f5a3
commit 4bc983d7b7
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -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)
{
+4
View File
@@ -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();