diff --git a/src/world/Action/Action.cpp b/src/world/Action/Action.cpp index 60c189b5..09a6a4fe 100644 --- a/src/world/Action/Action.cpp +++ b/src/world/Action/Action.cpp @@ -54,7 +54,8 @@ Action::Action::Action( Entity::CharaPtr caster, uint32_t actionId, uint16_t seq m_interruptType( Common::ActionInterruptType::None ), m_sequence( sequence ), m_isAutoAttack( false ), - m_disableGenericHandler( false ) + m_disableGenericHandler( false ), + m_started( false ) { } @@ -319,6 +320,8 @@ void Action::Action::start() // instantly finish cast if there's no cast time if( !hasCastTime() ) execute(); + + m_started = true; } void Action::Action::interrupt( ActionInterruptType type ) @@ -342,7 +345,7 @@ void Action::Action::interrupt( ActionInterruptType type ) player->unsetStateFlag( PlayerStateFlag::Casting ); } - if( hasCastTime() ) + if( m_started && hasCastTime() ) { uint8_t interruptEffect = 0; if( m_interruptType == ActionInterruptType::DamageInterrupt ) @@ -402,6 +405,8 @@ void Action::Action::execute() pScriptMgr->onEObjHit( *player, m_targetId, getId() ); } + m_started = false; + // set currently casted action as the combo action if it interrupts a combo // ignore it otherwise (ogcds, etc.) if( !m_actionData->preservesCombo ) diff --git a/src/world/Action/Action.h b/src/world/Action/Action.h index 107897cb..6281aad8 100644 --- a/src/world/Action/Action.h +++ b/src/world/Action/Action.h @@ -202,6 +202,7 @@ namespace Sapphire::World::Action bool m_canTargetDead; bool m_isAutoAttack; bool m_disableGenericHandler; + bool m_started; Common::ActionInterruptType m_interruptType;