mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-25 22:17:45 +00:00
Merge pull request #345 from NotAdam/develop
fix persist emotes not persisting & exiting out of a sit emote
This commit is contained in:
commit
39f58d1bdc
6 changed files with 12 additions and 9 deletions
|
@ -1426,6 +1426,7 @@ Core::Data::Emote::Emote( uint32_t row_id, Core::Data::ExdDataGenerated* exdData
|
|||
name = exdData->getField< std::string >( row, 0 );
|
||||
emoteCategory = exdData->getField< uint8_t >( row, 11 );
|
||||
emoteMode = exdData->getField< uint8_t >( row, 12 );
|
||||
hasCancelEmote = exdData->getField< bool >( row, 15 );
|
||||
textCommand = exdData->getField< int32_t >( row, 18 );
|
||||
icon = exdData->getField< uint16_t >( row, 19 );
|
||||
logMessageTargeted = exdData->getField< uint16_t >( row, 20 );
|
||||
|
|
|
@ -1604,6 +1604,7 @@ struct Emote
|
|||
uint16_t logMessageTargeted;
|
||||
uint16_t logMessageUntargeted;
|
||||
uint8_t emoteMode;
|
||||
bool hasCancelEmote;
|
||||
|
||||
Emote( uint32_t row_id, Core::Data::ExdDataGenerated* exdData );
|
||||
};
|
||||
|
|
|
@ -67,7 +67,7 @@ Core::Entity::Player::Player() :
|
|||
m_bAutoattack( false ),
|
||||
m_markedForRemoval( false ),
|
||||
m_mount( 0 ),
|
||||
m_emote( 0 ),
|
||||
m_emoteMode( 0 ),
|
||||
m_directorInitialized( false ),
|
||||
m_onEnterEventDone( false )
|
||||
{
|
||||
|
@ -1384,12 +1384,12 @@ uint8_t Core::Entity::Player::getCurrentMount() const
|
|||
|
||||
void Core::Entity::Player::setPersistentEmote( uint32_t emoteId )
|
||||
{
|
||||
m_emote = emoteId;
|
||||
m_emoteMode = emoteId;
|
||||
}
|
||||
|
||||
uint32_t Core::Entity::Player::getPersistentEmote() const
|
||||
{
|
||||
return m_emote;
|
||||
return m_emoteMode;
|
||||
}
|
||||
|
||||
void Core::Entity::Player::autoAttack( CharaPtr pTarget )
|
||||
|
|
|
@ -718,7 +718,7 @@ private:
|
|||
uint32_t m_cfPenaltyUntil; // unix time
|
||||
|
||||
uint8_t m_mount;
|
||||
uint32_t m_emote;
|
||||
uint32_t m_emoteMode;
|
||||
|
||||
Util::SpawnIndexAllocator< uint8_t > m_objSpawnIndexAllocator;
|
||||
Util::SpawnIndexAllocator< uint8_t > m_actorSpawnIndexAllocator;
|
||||
|
|
|
@ -125,9 +125,9 @@ bool Core::Entity::Player::load( uint32_t charId, SessionPtr pSession )
|
|||
m_birthDay = res->getUInt8( "BirthDay" );
|
||||
m_birthMonth = res->getUInt8( "BirthMonth" );
|
||||
m_status = static_cast< ActorStatus >( res->getUInt( "Status" ) );
|
||||
m_emoteMode = res->getUInt( "EmoteModeType" );
|
||||
|
||||
if( m_status == Entity::Chara::ActorStatus::EmoteMode )
|
||||
m_status = Entity::Chara::ActorStatus::Idle;
|
||||
m_activeTitle = res->getUInt16( "ActiveTitle" );
|
||||
|
||||
m_class = static_cast< ClassJob >( res->getUInt( "Class" ) );
|
||||
m_homePoint = res->getUInt8( "Homepoint" );
|
||||
|
@ -352,7 +352,7 @@ void Core::Entity::Player::updateSql()
|
|||
memcpy( modelVec.data(), m_modelEquip, sizeof( m_modelEquip ) );
|
||||
stmt->setBinary( 13, modelVec );
|
||||
|
||||
stmt->setInt( 14, 0 ); // EmodeModeType
|
||||
stmt->setInt( 14, m_emoteMode ); // EmodeModeType
|
||||
stmt->setInt( 15, 0 ); // Language
|
||||
|
||||
stmt->setInt( 16, static_cast< uint32_t >( m_bNewGame ) );
|
||||
|
@ -379,7 +379,7 @@ void Core::Entity::Player::updateSql()
|
|||
|
||||
stmt->setBinary( 34, { 0, 0, 0 } ); // FavoritePoint
|
||||
stmt->setInt( 35, 0 ); // RestPoint
|
||||
stmt->setInt( 36, 0 ); // ActiveTitle
|
||||
stmt->setInt( 36, m_activeTitle ); // ActiveTitle
|
||||
|
||||
std::vector< uint8_t > titleListVec( sizeof ( m_titleList ) );
|
||||
stmt->setBinary( 37, titleListVec );
|
||||
|
|
|
@ -158,9 +158,10 @@ void Core::Network::GameConnection::clientTriggerHandler( const Packets::FFXIVAR
|
|||
player.setAutoattack( false );
|
||||
player.setPersistentEmote( emoteData->emoteMode );
|
||||
player.setStatus( Entity::Chara::ActorStatus::EmoteMode );
|
||||
|
||||
player.sendToInRangeSet(
|
||||
boost::make_shared< ActorControlPacket142 >( player.getId(), ActorControlType::SetStatus,
|
||||
static_cast< uint8_t >( Entity::Chara::ActorStatus::EmoteMode ) ), true );
|
||||
static_cast< uint8_t >( Entity::Chara::ActorStatus::EmoteMode ), emoteData->hasCancelEmote ? 1 : 0 ), true );
|
||||
}
|
||||
|
||||
player.emote( emoteId, targetId, isSilent );
|
||||
|
|
Loading…
Add table
Reference in a new issue