From aaaee6c6a4baec132e7b37f89c3658bab7b519aa Mon Sep 17 00:00:00 2001 From: Paul Coene Date: Fri, 27 May 2022 15:30:38 -0400 Subject: [PATCH] [Bug Fix] IsDamage test for lifetap was not complete. (#2213) * [Bug Fix] IsDamage test for lifetap was not complete. * Fix magic # and formatting as per Kingly * Added #define --- common/spdat.cpp | 20 ++++++++++++-------- common/spdat.h | 1 + 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/common/spdat.cpp b/common/spdat.cpp index 2c22bcd33..b3bb811d1 100644 --- a/common/spdat.cpp +++ b/common/spdat.cpp @@ -101,14 +101,18 @@ bool IsSacrificeSpell(uint16 spell_id) bool IsLifetapSpell(uint16 spell_id) { - // Ancient Lifebane: 2115 - if (IsValidSpell(spell_id) && - (spells[spell_id].target_type == ST_Tap || - spells[spell_id].target_type == ST_TargetAETap || - spell_id == 2115)) - return true; + if ( + IsValidSpell(spell_id) && + ( + spells[spell_id].target_type == ST_Tap || + spells[spell_id].target_type == ST_TargetAETap || + spell_id == SPELL_ANCIENT_LIFEBANE + ) + ) { + return true; + } - return false; + return false; } bool IsMezSpell(uint16 spell_id) @@ -139,7 +143,7 @@ bool IsEvacSpell(uint16 spellid) bool IsDamageSpell(uint16 spellid) { - if (spells[spellid].target_type == ST_Tap) + if (IsLifetapSpell(spellid)) return false; for (int o = 0; o < EFFECT_COUNT; o++) { diff --git a/common/spdat.h b/common/spdat.h index 3a0d1636a..0159fe52c 100644 --- a/common/spdat.h +++ b/common/spdat.h @@ -169,6 +169,7 @@ #define SPELL_ILLUSION_FEMALE 1731 #define SPELL_ILLUSION_MALE 1732 #define SPELL_UNSUMMON_SELF 892 +#define SPELL_ANCIENT_LIFEBANE 2115 //spellgroup ids #define SPELLGROUP_FRENZIED_BURNOUT 2754