diff --git a/src/common/Common.h b/src/common/Common.h index b69a71d5..d86e57a0 100644 --- a/src/common/Common.h +++ b/src/common/Common.h @@ -639,6 +639,13 @@ namespace Sapphire::Common Unknown3 }; + enum class ActionInterruptType : uint8_t + { + None, + RegularInterrupt, + DamageInterrupt, + }; + enum HandleActionType : uint8_t { Event, diff --git a/src/world/Action/Action.cpp b/src/world/Action/Action.cpp index abcf070c..4663fadc 100644 --- a/src/world/Action/Action.cpp +++ b/src/world/Action/Action.cpp @@ -28,7 +28,7 @@ Sapphire::Action::Action::Action( Entity::CharaPtr caster, uint32_t actionId, m_pFw( std::move( fw ) ), m_id( actionId ), m_startTime( 0 ), - m_interruptType( ActionInterruptType::None ) + m_interruptType( Common::ActionInterruptType::None ) { m_castTime = static_cast< uint32_t >( action->cast100ms * 100 ); m_cooldownTime = static_cast< uint16_t >( action->recast100ms * 100 ); @@ -74,10 +74,10 @@ Sapphire::Entity::CharaPtr Sapphire::Action::Action::getTargetChara() const bool Sapphire::Action::Action::isInterrupted() const { - return m_interruptType != ActionInterruptType::None; + return m_interruptType != Common::ActionInterruptType::None; } -void Sapphire::Action::Action::setInterrupted( ActionInterruptType type ) +void Sapphire::Action::Action::setInterrupted( Common::ActionInterruptType type ) { m_interruptType = type; } @@ -174,7 +174,7 @@ void Sapphire::Action::Action::onInterrupt() // reset state flag //player->unsetStateFlag( PlayerStateFlag::Occupied1 ); player->unsetStateFlag( PlayerStateFlag::Casting ); - + player->sendDebug( "onInterrupt()" ); } diff --git a/src/world/Action/Action.h b/src/world/Action/Action.h index 0bc0c083..42ff64b3 100644 --- a/src/world/Action/Action.h +++ b/src/world/Action/Action.h @@ -24,13 +24,6 @@ namespace Sapphire::Action uint16_t m_cost; }; - enum class ActionInterruptType : uint8_t - { - None, - RegularInterrupt, - DamageInterrupt, - }; - using ActionCostArray = std::array< ActionCostEntry, 2 >; Action(); @@ -48,7 +41,7 @@ namespace Sapphire::Action Entity::CharaPtr getActionSource() const; bool isInterrupted() const; - void setInterrupted( ActionInterruptType type ); + void setInterrupted( Common::ActionInterruptType type ); uint32_t getCastTime() const; void setCastTime( uint32_t castTime ); @@ -127,7 +120,7 @@ namespace Sapphire::Action Entity::CharaPtr m_pTarget; uint64_t m_targetId; - ActionInterruptType m_interruptType; + Common::ActionInterruptType m_interruptType; FrameworkPtr m_pFw; diff --git a/src/world/Network/Handlers/ClientTriggerHandler.cpp b/src/world/Network/Handlers/ClientTriggerHandler.cpp index 63fd35f4..846fa319 100644 --- a/src/world/Network/Handlers/ClientTriggerHandler.cpp +++ b/src/world/Network/Handlers/ClientTriggerHandler.cpp @@ -139,7 +139,7 @@ void Sapphire::Network::GameConnection::clientTriggerHandler( FrameworkPtr pFw, case ClientTriggerType::CastCancel: // Cancel cast { if( player.getCurrentAction() ) - player.getCurrentAction()->setInterrupted( Action::Action::ActionInterruptType::RegularInterrupt ); + player.getCurrentAction()->setInterrupted( Common::ActionInterruptType::RegularInterrupt ); break; } case ClientTriggerType::Examine: diff --git a/src/world/Network/Handlers/PacketHandlers.cpp b/src/world/Network/Handlers/PacketHandlers.cpp index fb5fcd97..6ab6cd0d 100644 --- a/src/world/Network/Handlers/PacketHandlers.cpp +++ b/src/world/Network/Handlers/PacketHandlers.cpp @@ -196,7 +196,7 @@ void Sapphire::Network::GameConnection::updatePositionHandler( FrameworkPtr pFw, player.setPos( updatePositionPacket.data().position ); if( ( player.getCurrentAction() != nullptr ) && bPosChanged ) - player.getCurrentAction()->setInterrupted( Action::Action::ActionInterruptType::RegularInterrupt ); + player.getCurrentAction()->setInterrupted( Common::ActionInterruptType::RegularInterrupt ); // if no one is in range, don't bother trying to send a position update if( !player.hasInRangeActor() )