1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-25 22:17:45 +00:00

Missed a few state flags functions during renaming.

This commit is contained in:
Mordred 2023-02-20 16:41:04 +01:00
parent 6bf3ac0be8
commit 065c1817bd
8 changed files with 16 additions and 16 deletions

View file

@ -61,7 +61,7 @@ void Action::EventAction::start()
server().queueForPlayers( m_pSource->getInRangePlayerIds( true ), control );
if( pPlayer->hasStateFlag( PlayerCondition::InNpcEvent ) )
if( pPlayer->hasCondition( PlayerCondition::InNpcEvent ) )
Service< World::Manager::PlayerMgr >::ref().removeCondition( *pPlayer, PlayerCondition::InNpcEvent );
}
else

View file

@ -861,12 +861,12 @@ void Player::setGcRankAt( uint8_t index, uint8_t rank )
m_gcRank[ index ] = rank;
}
const Player::StateFlags& Player::getStateFlags() const
const Player::Condition& Player::getConditions() const
{
return m_condition;
}
bool Player::hasStateFlag( Common::PlayerCondition flag ) const
bool Player::hasCondition( Common::PlayerCondition flag ) const
{
auto iFlag = static_cast< int32_t >( flag );
@ -890,7 +890,7 @@ void Player::setCondition( Common::PlayerCondition flag )
void Player::removeCondition( Common::PlayerCondition flag )
{
if( !hasStateFlag( flag ) )
if( !hasCondition( flag ) )
return;
auto iFlag = static_cast< int32_t >( flag );

View file

@ -34,7 +34,7 @@ namespace Sapphire::Entity
using AetheryteList = std::array< uint8_t, Common::ARRSIZE_AETHERYTES >;
using UnlockList = std::array< uint8_t, Common::ARRSIZE_UNLOCKS >;
using OrchestrionList = std::array< uint8_t, Common::ARRSIZE_ORCHESTRION >;
using StateFlags = std::array< uint8_t, 12 >;
using Condition = std::array< uint8_t, 12 >;
using ClassList = std::array< uint16_t, Common::ARRSIZE_CLASSJOB >;
using ExpList = std::array< uint32_t, Common::ARRSIZE_CLASSJOB >;
@ -526,16 +526,16 @@ namespace Sapphire::Entity
// Player State Handling
//////////////////////////////////////////////////////////////////////////////////////////////////////
/* return a const pointer to the state flag array */
const StateFlags& getStateFlags() const;
const Condition& getConditions() const;
/* set a specified state flag */
void setCondition( Common::PlayerCondition flag );
/* set a specified state flag */
void setStateFlags( std::vector< Common::PlayerCondition > flags );
void setConditions( std::vector< Common::PlayerCondition > flags );
/* check if a specified flag is set */
bool hasStateFlag( Common::PlayerCondition flag ) const;
bool hasCondition( Common::PlayerCondition flag ) const;
/* reset a specified flag */
void removeCondition( Common::PlayerCondition flag );
@ -901,7 +901,7 @@ namespace Sapphire::Entity
OrchestrionList m_orchestrion{};
ClassList m_classArray{};
ExpList m_expArray{};
StateFlags m_condition{};
Condition m_condition{};
Common::ClassJob m_firstClass{};

View file

@ -550,7 +550,7 @@ void EventMgr::eventFinish( Sapphire::Entity::Player& player, uint32_t eventId,
}
}
if( player.hasStateFlag( Common::PlayerCondition::WatchingCutscene ) )
if( player.hasCondition( Common::PlayerCondition::WatchingCutscene ) )
Common::Service< World::Manager::PlayerMgr >::ref().removeCondition( player, Common::PlayerCondition::WatchingCutscene );
player.removeEvent( pEvent->getId() );

View file

@ -182,7 +182,7 @@ void Sapphire::Network::GameConnection::joinChatChannelHandler( const Packets::F
void Sapphire::Network::GameConnection::moveHandler( const Packets::FFXIVARR_PACKET_RAW& inPacket, Entity::Player& player )
{
if( player.hasStateFlag( Common::BetweenAreas ) )
if( player.hasCondition( Common::BetweenAreas ) )
return;
const auto updatePositionPacket = ZoneChannelPacket< Client::FFXIVIpcUpdatePosition >( inPacket );
auto& data = updatePositionPacket.data();
@ -523,7 +523,7 @@ void Sapphire::Network::GameConnection::tellHandler( const Packets::FFXIVARR_PAC
auto pTargetPlayer = pSession->getPlayer();
if( pTargetPlayer->hasStateFlag( PlayerCondition::BetweenAreas ) )
if( pTargetPlayer->hasCondition( PlayerCondition::BetweenAreas ) )
{
// send error for player between areas
// TODO: implement me
@ -538,7 +538,7 @@ void Sapphire::Network::GameConnection::tellHandler( const Packets::FFXIVARR_PAC
return;
}
if( pTargetPlayer->hasStateFlag( PlayerCondition::BoundByDuty ) && !player.isActingAsGm() )
if( pTargetPlayer->hasCondition( PlayerCondition::BoundByDuty ) && !player.isActingAsGm() )
{
auto boundPacket = makeChatPacket< Packets::Server::FFXIVRecvFinderStatus >( player.getId() );
strcpy( boundPacket->data().toName, data.toName );

View file

@ -17,7 +17,7 @@ namespace Sapphire::Network::Packets::WorldPackets::Server
ConditionPacket( Entity::Player& player ) :
ZoneChannelPacket< FFXIVIpcCondition >( player.getId(), player.getId() )
{
initialize( player.getStateFlags().data() );
initialize( player.getConditions().data() );
}
ConditionPacket( Entity::Player& player, std::vector< Common::PlayerCondition > flags ) :

View file

@ -140,7 +140,7 @@ void Sapphire::InstanceContent::onUpdate( uint64_t tickCount )
auto player = it->second;
if( !player->isLoadingComplete() ||
!player->isDirectorInitialized() ||
player->hasStateFlag( PlayerCondition::WatchingCutscene ) )
player->hasCondition( PlayerCondition::WatchingCutscene ) )
return;
}

View file

@ -118,7 +118,7 @@ void Sapphire::QuestBattle::onUpdate( uint64_t tickCount )
if( !m_pPlayer->isLoadingComplete() ||
!m_pPlayer->isDirectorInitialized() ||
!m_pPlayer->isOnEnterEventDone() ||
m_pPlayer->hasStateFlag( PlayerCondition::WatchingCutscene ) )
m_pPlayer->hasCondition( PlayerCondition::WatchingCutscene ) )
return;
if( m_instanceCommenceTime == 0 )