aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities/Unit
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2024-06-21 21:17:16 +0200
committerShauren <shauren.trinity@gmail.com>2024-06-21 21:17:16 +0200
commitb1c15cbfe61884664ed7615a34ca77ad0db3d95c (patch)
tree816f5cab65bdbce0b4736aecf39d3d55945723a0 /src/server/game/Entities/Unit
parentb1a0dfa5d3f42612257cc3cde27f3831d4f8ad58 (diff)
Core/Spells: Corrected SpellCastResult values sent on spell interrupts
Diffstat (limited to 'src/server/game/Entities/Unit')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp4
-rw-r--r--src/server/game/Entities/Unit/Unit.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index d412b619be7..94cdf8c3118 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -3015,7 +3015,7 @@ void Unit::SetCurrentCastSpell(Spell* pSpell)
pSpell->m_selfContainer = &(m_currentSpells[pSpell->GetCurrentContainer()]);
}
-void Unit::InterruptSpell(CurrentSpellTypes spellType, bool withDelayed, bool withInstant)
+void Unit::InterruptSpell(CurrentSpellTypes spellType, bool withDelayed, bool withInstant, SpellCastResult result, Optional<SpellCastResult> resultOther /*= {}*/)
{
//TC_LOG_DEBUG("entities.unit", "Interrupt spell for unit {}.", GetEntry());
Spell* spell = m_currentSpells[spellType];
@@ -3033,7 +3033,7 @@ void Unit::InterruptSpell(CurrentSpellTypes spellType, bool withDelayed, bool wi
ToPlayer()->SendAutoRepeatCancel(this);
if (spell->getState() != SPELL_STATE_FINISHED)
- spell->cancel();
+ spell->cancel(result, resultOther);
else
{
m_currentSpells[spellType] = nullptr;
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index 970d55a274a..a969ee0214f 100644
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -1460,7 +1460,7 @@ class TC_GAME_API Unit : public WorldObject
void SetChannelObjectGuid(ObjectGuid guid) { SetGuidValue(UNIT_FIELD_CHANNEL_OBJECT, guid); }
void SetCurrentCastSpell(Spell* pSpell);
- void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed = true, bool withInstant = true);
+ void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed = true, bool withInstant = true, SpellCastResult result = SPELL_FAILED_INTERRUPTED, Optional<SpellCastResult> resultOther = {});
void FinishSpell(CurrentSpellTypes spellType, bool ok = true);
// set withDelayed to true to account delayed spells as cast