1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-01 08:27:46 +00:00

Merge pull request #288 from NotAdam/actor_rewrite

fix OnlineStatus so it'll return the one with the highest priority
This commit is contained in:
Mordred 2018-04-24 12:40:18 +02:00 committed by GitHub
commit b3a1254077
2 changed files with 5 additions and 4 deletions

View file

@ -174,7 +174,7 @@ Core::Common::OnlineStatus Core::Entity::Player::getOnlineStatus()
return OnlineStatus::Online; return OnlineStatus::Online;
uint32_t statusDisplayOrder = 0xFF14; uint32_t statusDisplayOrder = 0xFF14;
uint32_t applicableStatus = 0; uint32_t applicableStatus = static_cast< uint32_t >( OnlineStatus::Online );
for( uint32_t i = 0; i < std::numeric_limits< decltype( m_onlineStatus ) >::digits; i++ ) for( uint32_t i = 0; i < std::numeric_limits< decltype( m_onlineStatus ) >::digits; i++ )
{ {
@ -192,10 +192,11 @@ Core::Common::OnlineStatus Core::Entity::Player::getOnlineStatus()
// todo: also check that the status can actually be set here, otherwise we need to ignore it (and ban the player obv) // todo: also check that the status can actually be set here, otherwise we need to ignore it (and ban the player obv)
statusDisplayOrder = pOnlineStatus->priority; statusDisplayOrder = pOnlineStatus->priority;
applicableStatus = i; applicableStatus = i;
}
}
return static_cast< OnlineStatus >( applicableStatus ); return static_cast< OnlineStatus >( applicableStatus );
} }
}
}
void Core::Entity::Player::setOnlineStatusMask( uint64_t status ) void Core::Entity::Player::setOnlineStatusMask( uint64_t status )
{ {

View file

@ -12,10 +12,10 @@
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <winbase.h> #include <winbase.h>
typedef HMODULE ModuleHandle; using ModuleHandle = HMODULE;
#else #else
#include <dlfcn.h> #include <dlfcn.h>
typedef void* ModuleHandle; using ModuleHandle = void*;
#endif #endif
namespace Core { namespace Core {