1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-26 06:27:45 +00:00

fix mounting & mount persistance

This commit is contained in:
GokuWeedLord 2017-11-21 17:39:10 +11:00
parent 7161de22ac
commit 21cc47e510
4 changed files with 14 additions and 13 deletions

View file

@ -71,7 +71,8 @@ Core::Entity::Player::Player() :
m_bMarkedForZoning( false ), m_bMarkedForZoning( false ),
m_zoningType( Common::ZoneingType::None ), m_zoningType( Common::ZoneingType::None ),
m_bAutoattack( false ), m_bAutoattack( false ),
m_markedForRemoval( false ) m_markedForRemoval( false ),
m_mount( 0 )
{ {
m_id = 0; m_id = 0;
m_type = ActorType::Player; m_type = ActorType::Player;
@ -1447,29 +1448,25 @@ uint8_t Core::Entity::Player::getEquipDisplayFlags() const
void Core::Entity::Player::mount( uint32_t id ) void Core::Entity::Player::mount( uint32_t id )
{ {
// TODO: Fix me for SQL rewrite m_mount = id;
/* m_mount = id;
sendToInRangeSet( ActorControlPacket142( getId(), ActorControlType::SetStatus, static_cast< uint8_t >( Entity::Actor::ActorStatus::Mounted )), true ); sendToInRangeSet( ActorControlPacket142( getId(), ActorControlType::SetStatus, static_cast< uint8_t >( Entity::Actor::ActorStatus::Mounted )), true );
sendToInRangeSet( ActorControlPacket143( getId(), 0x39e, 12 ), true ); //? sendToInRangeSet( ActorControlPacket143( getId(), 0x39e, 12 ), true ); //?
GamePacketNew< FFXIVIpcMount, ServerZoneIpcType > mountPacket( getId() ); GamePacketNew< FFXIVIpcMount, ServerZoneIpcType > mountPacket( getId() );
mountPacket.data().id = m_mount; mountPacket.data().id = id;
sendToInRangeSet( mountPacket, true );*/ sendToInRangeSet( mountPacket, true );
} }
void Core::Entity::Player::dismount() void Core::Entity::Player::dismount()
{ {
// TODO: Fix me for SQL rewrite sendToInRangeSet( ActorControlPacket142( getId(), ActorControlType::SetStatus, static_cast< uint8_t >( Entity::Actor::ActorStatus::Idle )), true );
/* sendToInRangeSet( ActorControlPacket142( getId(), ActorControlType::SetStatus, static_cast< uint8_t >( Entity::Actor::ActorStatus::Idle )), true );
sendToInRangeSet( ActorControlPacket143( getId(), ActorControlType::Dismount, 1 ), true ); sendToInRangeSet( ActorControlPacket143( getId(), ActorControlType::Dismount, 1 ), true );
m_mount = 0;*/ m_mount = 0;
} }
uint8_t Core::Entity::Player::getCurrentMount() const uint8_t Core::Entity::Player::getCurrentMount() const
{ {
// TODO: Fix me for SQL rewrite return m_mount;
// return m_mount;
return 0;
} }
void Core::Entity::Player::autoAttack( ActorPtr pTarget ) void Core::Entity::Player::autoAttack( ActorPtr pTarget )

View file

@ -629,6 +629,8 @@ private:
// content finder info // content finder info
uint32_t m_cfPenaltyUntil; // unix time uint32_t m_cfPenaltyUntil; // unix time
uint8_t m_mount;
}; };
} }

View file

@ -166,6 +166,8 @@ bool Core::Entity::Player::load( uint32_t charId, Core::SessionPtr pSession )
m_maxHp = getMaxHp(); m_maxHp = getMaxHp();
m_maxMp = getMaxMp(); m_maxMp = getMaxMp();
m_mount = res->getUInt8( "Mount" );
m_modelSubWeapon = 0; m_modelSubWeapon = 0;
m_lastTickTime = 0; m_lastTickTime = 0;
@ -305,7 +307,7 @@ void Core::Entity::Player::updateSql()
stmt->setInt( 3, 0 ); // TP stmt->setInt( 3, 0 ); // TP
stmt->setInt( 4, 0 ); // GP stmt->setInt( 4, 0 ); // GP
stmt->setInt( 5, 0 ); // Mode stmt->setInt( 5, 0 ); // Mode
stmt->setInt( 6, 0 ); // Mount stmt->setInt( 6, m_mount ); // Mount
stmt->setInt( 7, 0 ); // InvicibleGM stmt->setInt( 7, 0 ); // InvicibleGM
stmt->setInt( 8, m_voice ); stmt->setInt( 8, m_voice );

View file

@ -72,7 +72,7 @@ namespace Server {
m_data.title = pPlayer->getTitle(); m_data.title = pPlayer->getTitle();
m_data.voice = pPlayer->getVoiceId(); m_data.voice = pPlayer->getVoiceId();
m_data.currentMount = 0; m_data.currentMount = pPlayer->getCurrentMount();
m_data.onlineStatus = static_cast< uint8_t >( pPlayer->getOnlineStatus() ); m_data.onlineStatus = static_cast< uint8_t >( pPlayer->getOnlineStatus() );