Skip to content

Commit

Permalink
Removed default aura remove handler and fixed sending of aura expiration
Browse files Browse the repository at this point in the history
  • Loading branch information
Arcidev committed Aug 9, 2024
1 parent b552e80 commit cdb667e
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 9 deletions.
1 change: 1 addition & 0 deletions Server/Server/Cards/PlayableCard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ void PlayableCard::HandleTickOnAuras()
}

iter->second.Remove();
m_owner->SendAuraExpired(m_guid, iter->second);
iter = m_auras.erase(iter);
}
}
Expand Down
1 change: 0 additions & 1 deletion Server/Server/Spells/SpellAuraEffect.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "SpellAuraEffect.h"
#include "../Player.h"

SpellAuraEffect::SpellAuraEffect(PlayableCard* card, PlayableCard const* caster, uint32_t spellId, uint32_t spellValueId, uint8_t id, uint8_t duration, uint8_t value1, uint8_t value, uint32_t spellAttributes)
: m_card(card), m_caster(caster), m_SpellAuraEffectHandler(SpellAuraEffectHandler::GetAuraEffectTickHandler(id)), m_spellId(spellId), m_spellValueId(spellValueId), m_id(id), m_duration(duration), m_currentTick(0), m_value1(value1), m_value2(value), m_spellAttributes(spellAttributes)
Expand Down
9 changes: 2 additions & 7 deletions Server/Server/Spells/SpellAuraEffectHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

SpellAuraEffectFuncWrapper const SpellAuraEffectHandler::m_spellAuraEffectHandlers[] =
{
{ defaultApplyHandler, defaultRemoveHandler, handleDamageOnTick }, // SPELL_AURA_EFFECT_DAMAGE
{ defaultApplyHandler, nullptr, handleDamageOnTick }, // SPELL_AURA_EFFECT_DAMAGE
{ statChangedApplyHandler, statChangedRemoveHandler, nullptr }, // SPELL_AURA_EFFECT_MODIFY_STAT
{ defaultApplyHandler, defaultRemoveHandler, handleHealOnTick }, // SPELL_AURA_EFFECT_HEAL
{ defaultApplyHandler, nullptr, handleHealOnTick }, // SPELL_AURA_EFFECT_HEAL
{ morphApplyHandler, morphRemoveHandler, nullptr } // SPELL_AURA_EFFECT_MORPH
};

Expand All @@ -18,11 +18,6 @@ void SpellAuraEffectHandler::defaultApplyHandler(SpellEffectValues const& effect
applyAuraEffect(effectValues, targetCard, caster->GetCurrentCard());
}

void SpellAuraEffectHandler::defaultRemoveHandler(SpellAuraEffect const& aura, PlayableCard* card)
{
card->GetOwner()->SendAuraExpired(card->GetGuid(), aura);
}

void SpellAuraEffectHandler::handleDamageOnTick(PlayableCard* card, uint8_t damage, uint32_t spellAttributes, PlayableCard const* caster)
{
damage = (std::max)(damage + caster->GetStatModifierValue(CardStats::CARD_STAT_SPELL_DAMAGE) + card->GetStatModifierValue(CardStats::CARD_STAT_SPELL_DAMAGE_TAKEN), 0);
Expand Down
1 change: 0 additions & 1 deletion Server/Server/Spells/SpellAuraEffectHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class SpellAuraEffectHandler
static SpellAuraEffectFuncWrapper const m_spellAuraEffectHandlers[];

static void defaultApplyHandler(SpellEffectValues const& effectValues, Player* caster, PlayableCard* targetCard);
static void defaultRemoveHandler(SpellAuraEffect const& aura, PlayableCard* card);

// SPELL_AURA_EFFECT_DAMAGE
static void handleDamageOnTick(PlayableCard* card, uint8_t damage, uint32_t spellAttributes, PlayableCard const* caster);
Expand Down

0 comments on commit cdb667e

Please sign in to comment.