diff --git a/src/world/Event/EventHandler.h b/src/world/Event/EventHandler.h index 285cc59d..8b6016c6 100644 --- a/src/world/Event/EventHandler.h +++ b/src/world/Event/EventHandler.h @@ -45,7 +45,7 @@ namespace Sapphire::Event TableGame = 24, }; - enum EventHandlerType : uint16_t + enum class EventHandlerType : uint16_t { Quest = 0x0001, Warp = 0x0002, diff --git a/src/world/Network/Handlers/EventHandlers.cpp b/src/world/Network/Handlers/EventHandlers.cpp index ae2ccb87..929bc90b 100644 --- a/src/world/Network/Handlers/EventHandlers.cpp +++ b/src/world/Network/Handlers/EventHandlers.cpp @@ -42,7 +42,7 @@ void Sapphire::Network::GameConnection::eventHandlerTalk( const Packets::FFXIVAR const auto actorId = packet.data().actorId; const auto eventId = packet.data().eventId; - auto eventType = static_cast< uint16_t >( eventId >> 16 ); + auto eventType = static_cast< Event::EventHandler::EventHandlerType >( eventId >> 16 ); std::string eventName = "onTalk"; std::string objName = eventMgr.getEventName( eventId ); @@ -83,7 +83,7 @@ void Sapphire::Network::GameConnection::eventHandlerEmote( const Packets::FFXIVA const auto actorId = packet.data().actorId; const auto eventId = packet.data().eventId; const auto emoteId = packet.data().emoteId; - const auto eventType = static_cast< uint16_t >( eventId >> 16 ); + const auto eventType = static_cast< Event::EventHandler::EventHandlerType >( eventId >> 16 ); std::string eventName = "onEmote"; std::string objName = eventMgr.getEventName( eventId ); diff --git a/src/world/Script/ScriptMgr.cpp b/src/world/Script/ScriptMgr.cpp index b7e082bd..e9f9a2a5 100644 --- a/src/world/Script/ScriptMgr.cpp +++ b/src/world/Script/ScriptMgr.cpp @@ -284,7 +284,7 @@ bool Sapphire::Scripting::ScriptMgr::onBNpcKill( Entity::Player& player, uint16_ if( !activeQuests ) continue; - uint32_t questId = activeQuests->c.questId | Event::EventHandler::EventHandlerType::Quest << 16; + uint32_t questId = activeQuests->c.questId | static_cast< uint16_t >( Event::EventHandler::EventHandlerType::Quest ) << 16; auto script = m_nativeScriptMgr->getScript< Sapphire::ScriptAPI::EventScript >( questId ); if( script ) @@ -311,7 +311,7 @@ bool Sapphire::Scripting::ScriptMgr::onEObjHit( Sapphire::Entity::Player& player if( !activeQuests ) continue; - uint32_t questId = activeQuests->c.questId | Event::EventHandler::EventHandlerType::Quest << 16; + uint32_t questId = activeQuests->c.questId | static_cast< uint16_t >( Event::EventHandler::EventHandlerType::Quest ) << 16; auto script = m_nativeScriptMgr->getScript< Sapphire::ScriptAPI::EventScript >( questId ); if( script )