1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-29 15:47:46 +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:
Mordred 2018-07-11 15:46:41 +02:00 committed by GitHub
commit 39f58d1bdc
6 changed files with 12 additions and 9 deletions

View file

@ -1426,6 +1426,7 @@ Core::Data::Emote::Emote( uint32_t row_id, Core::Data::ExdDataGenerated* exdData
name = exdData->getField< std::string >( row, 0 ); name = exdData->getField< std::string >( row, 0 );
emoteCategory = exdData->getField< uint8_t >( row, 11 ); emoteCategory = exdData->getField< uint8_t >( row, 11 );
emoteMode = exdData->getField< uint8_t >( row, 12 ); emoteMode = exdData->getField< uint8_t >( row, 12 );
hasCancelEmote = exdData->getField< bool >( row, 15 );
textCommand = exdData->getField< int32_t >( row, 18 ); textCommand = exdData->getField< int32_t >( row, 18 );
icon = exdData->getField< uint16_t >( row, 19 ); icon = exdData->getField< uint16_t >( row, 19 );
logMessageTargeted = exdData->getField< uint16_t >( row, 20 ); logMessageTargeted = exdData->getField< uint16_t >( row, 20 );

View file

@ -1604,6 +1604,7 @@ struct Emote
uint16_t logMessageTargeted; uint16_t logMessageTargeted;
uint16_t logMessageUntargeted; uint16_t logMessageUntargeted;
uint8_t emoteMode; uint8_t emoteMode;
bool hasCancelEmote;
Emote( uint32_t row_id, Core::Data::ExdDataGenerated* exdData ); Emote( uint32_t row_id, Core::Data::ExdDataGenerated* exdData );
}; };

View file

@ -67,7 +67,7 @@ Core::Entity::Player::Player() :
m_bAutoattack( false ), m_bAutoattack( false ),
m_markedForRemoval( false ), m_markedForRemoval( false ),
m_mount( 0 ), m_mount( 0 ),
m_emote( 0 ), m_emoteMode( 0 ),
m_directorInitialized( false ), m_directorInitialized( false ),
m_onEnterEventDone( false ) m_onEnterEventDone( false )
{ {
@ -1384,12 +1384,12 @@ uint8_t Core::Entity::Player::getCurrentMount() const
void Core::Entity::Player::setPersistentEmote( uint32_t emoteId ) void Core::Entity::Player::setPersistentEmote( uint32_t emoteId )
{ {
m_emote = emoteId; m_emoteMode = emoteId;
} }
uint32_t Core::Entity::Player::getPersistentEmote() const uint32_t Core::Entity::Player::getPersistentEmote() const
{ {
return m_emote; return m_emoteMode;
} }
void Core::Entity::Player::autoAttack( CharaPtr pTarget ) void Core::Entity::Player::autoAttack( CharaPtr pTarget )

View file

@ -718,7 +718,7 @@ private:
uint32_t m_cfPenaltyUntil; // unix time uint32_t m_cfPenaltyUntil; // unix time
uint8_t m_mount; uint8_t m_mount;
uint32_t m_emote; uint32_t m_emoteMode;
Util::SpawnIndexAllocator< uint8_t > m_objSpawnIndexAllocator; Util::SpawnIndexAllocator< uint8_t > m_objSpawnIndexAllocator;
Util::SpawnIndexAllocator< uint8_t > m_actorSpawnIndexAllocator; Util::SpawnIndexAllocator< uint8_t > m_actorSpawnIndexAllocator;

View file

@ -125,9 +125,9 @@ bool Core::Entity::Player::load( uint32_t charId, SessionPtr pSession )
m_birthDay = res->getUInt8( "BirthDay" ); m_birthDay = res->getUInt8( "BirthDay" );
m_birthMonth = res->getUInt8( "BirthMonth" ); m_birthMonth = res->getUInt8( "BirthMonth" );
m_status = static_cast< ActorStatus >( res->getUInt( "Status" ) ); m_status = static_cast< ActorStatus >( res->getUInt( "Status" ) );
m_emoteMode = res->getUInt( "EmoteModeType" );
if( m_status == Entity::Chara::ActorStatus::EmoteMode ) m_activeTitle = res->getUInt16( "ActiveTitle" );
m_status = Entity::Chara::ActorStatus::Idle;
m_class = static_cast< ClassJob >( res->getUInt( "Class" ) ); m_class = static_cast< ClassJob >( res->getUInt( "Class" ) );
m_homePoint = res->getUInt8( "Homepoint" ); m_homePoint = res->getUInt8( "Homepoint" );
@ -352,7 +352,7 @@ void Core::Entity::Player::updateSql()
memcpy( modelVec.data(), m_modelEquip, sizeof( m_modelEquip ) ); memcpy( modelVec.data(), m_modelEquip, sizeof( m_modelEquip ) );
stmt->setBinary( 13, modelVec ); stmt->setBinary( 13, modelVec );
stmt->setInt( 14, 0 ); // EmodeModeType stmt->setInt( 14, m_emoteMode ); // EmodeModeType
stmt->setInt( 15, 0 ); // Language stmt->setInt( 15, 0 ); // Language
stmt->setInt( 16, static_cast< uint32_t >( m_bNewGame ) ); 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->setBinary( 34, { 0, 0, 0 } ); // FavoritePoint
stmt->setInt( 35, 0 ); // RestPoint stmt->setInt( 35, 0 ); // RestPoint
stmt->setInt( 36, 0 ); // ActiveTitle stmt->setInt( 36, m_activeTitle ); // ActiveTitle
std::vector< uint8_t > titleListVec( sizeof ( m_titleList ) ); std::vector< uint8_t > titleListVec( sizeof ( m_titleList ) );
stmt->setBinary( 37, titleListVec ); stmt->setBinary( 37, titleListVec );

View file

@ -158,9 +158,10 @@ void Core::Network::GameConnection::clientTriggerHandler( const Packets::FFXIVAR
player.setAutoattack( false ); player.setAutoattack( false );
player.setPersistentEmote( emoteData->emoteMode ); player.setPersistentEmote( emoteData->emoteMode );
player.setStatus( Entity::Chara::ActorStatus::EmoteMode ); player.setStatus( Entity::Chara::ActorStatus::EmoteMode );
player.sendToInRangeSet( player.sendToInRangeSet(
boost::make_shared< ActorControlPacket142 >( player.getId(), ActorControlType::SetStatus, 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 ); player.emote( emoteId, targetId, isSilent );