1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-26 03:27:44 +00:00

more fixes

This commit is contained in:
collett 2020-02-04 22:09:19 +09:00
parent ffb1a83494
commit 93479a9c75
2 changed files with 8 additions and 2 deletions

View file

@ -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 )

View file

@ -202,6 +202,7 @@ namespace Sapphire::World::Action
bool m_canTargetDead;
bool m_isAutoAttack;
bool m_disableGenericHandler;
bool m_started;
Common::ActionInterruptType m_interruptType;