Skip to content

Commit 56fb627

Browse files
committed
Core/Spells: Exclude TriggerCastFlags that can be set for non-triggered spells from being checked by Spell::IsTriggered
1 parent f63e715 commit 56fb627

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/server/game/Spells/Spell.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8376,7 +8376,7 @@ bool Spell::CheckEffectTarget(Item const* /*target*/, SpellEffectInfo const& /*s
83768376

83778377
bool Spell::IsTriggered() const
83788378
{
8379-
return (!m_fromClient && (_triggeredCastFlags & TRIGGERED_FULL_MASK) != 0)
8379+
return (!m_fromClient && (_triggeredCastFlags & TRIGGERED_IS_TRIGGERED_MASK) != 0)
83808380
|| !m_originalCastId.IsEmpty();
83818381
}
83828382

src/server/game/Spells/Spell.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ enum SpellCastFlags : uint32
9898
CAST_FLAG_UNKNOWN_8 = 0x00000080,
9999
CAST_FLAG_UNKNOWN_9 = 0x00000100,
100100
CAST_FLAG_UNKNOWN_10 = 0x00000200,
101-
CAST_FLAG_UNKNOWN_11 = 0x00000400,
101+
CAST_FLAG_UNKNOWN_11 = 0x00000400, // sorts missed targets before hit targets for chain visual
102102
CAST_FLAG_POWER_LEFT_SELF = 0x00000800,
103103
CAST_FLAG_UNKNOWN_13 = 0x00001000,
104104
CAST_FLAG_UNKNOWN_14 = 0x00002000,

src/server/game/Spells/SpellDefines.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,10 @@ enum TriggerCastFlags : uint32
275275
TRIGGERED_DONT_RESET_PERIODIC_TIMER = 0x00020000, //!< Will allow periodic aura timers to keep ticking (instead of resetting)
276276
TRIGGERED_DONT_REPORT_CAST_ERROR = 0x00040000, //!< Will return SPELL_FAILED_DONT_REPORT in CheckCast functions
277277
TRIGGERED_FULL_MASK = 0x0007FFFF, //!< Used when doing CastSpell with triggered == true
278+
TRIGGERED_IS_TRIGGERED_MASK = TRIGGERED_FULL_MASK
279+
& ~(TRIGGERED_IGNORE_POWER_COST | TRIGGERED_IGNORE_CAST_IN_PROGRESS
280+
| TRIGGERED_IGNORE_CAST_TIME | TRIGGERED_IGNORE_SHAPESHIFT
281+
| TRIGGERED_DONT_REPORT_CAST_ERROR), //!< Will be recognized by Spell::IsTriggered as triggered
278282

279283
// debug flags (used with .cast triggered commands)
280284
TRIGGERED_IGNORE_EQUIPPED_ITEM_REQUIREMENT = 0x00080000, //!< Will ignore equipped item requirements

0 commit comments

Comments
 (0)