diff --git a/src/servers/Server_Zone/Actor/Player.cpp b/src/servers/Server_Zone/Actor/Player.cpp index 26199d4e..8c41065a 100644 --- a/src/servers/Server_Zone/Actor/Player.cpp +++ b/src/servers/Server_Zone/Actor/Player.cpp @@ -71,7 +71,8 @@ Core::Entity::Player::Player() : m_bMarkedForZoning( false ), m_zoningType( Common::ZoneingType::None ), m_bAutoattack( false ), - m_markedForRemoval( false ) + m_markedForRemoval( false ), + m_mount( 0 ) { m_id = 0; m_type = ActorType::Player; @@ -1447,29 +1448,25 @@ uint8_t Core::Entity::Player::getEquipDisplayFlags() const 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( ActorControlPacket143( getId(), 0x39e, 12 ), true ); //? GamePacketNew< FFXIVIpcMount, ServerZoneIpcType > mountPacket( getId() ); - mountPacket.data().id = m_mount; - sendToInRangeSet( mountPacket, true );*/ + mountPacket.data().id = id; + sendToInRangeSet( mountPacket, true ); } 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 ); - m_mount = 0;*/ + m_mount = 0; } uint8_t Core::Entity::Player::getCurrentMount() const { -// TODO: Fix me for SQL rewrite -// return m_mount; - return 0; + return m_mount; } void Core::Entity::Player::autoAttack( ActorPtr pTarget ) diff --git a/src/servers/Server_Zone/Actor/Player.h b/src/servers/Server_Zone/Actor/Player.h index bc38df16..19ed8d71 100644 --- a/src/servers/Server_Zone/Actor/Player.h +++ b/src/servers/Server_Zone/Actor/Player.h @@ -629,6 +629,8 @@ private: // content finder info uint32_t m_cfPenaltyUntil; // unix time + + uint8_t m_mount; }; } diff --git a/src/servers/Server_Zone/Actor/PlayerSql.cpp b/src/servers/Server_Zone/Actor/PlayerSql.cpp index 5a185fe0..737c9754 100644 --- a/src/servers/Server_Zone/Actor/PlayerSql.cpp +++ b/src/servers/Server_Zone/Actor/PlayerSql.cpp @@ -166,6 +166,8 @@ bool Core::Entity::Player::load( uint32_t charId, Core::SessionPtr pSession ) m_maxHp = getMaxHp(); m_maxMp = getMaxMp(); + m_mount = res->getUInt8( "Mount" ); + m_modelSubWeapon = 0; m_lastTickTime = 0; @@ -305,7 +307,7 @@ void Core::Entity::Player::updateSql() stmt->setInt( 3, 0 ); // TP stmt->setInt( 4, 0 ); // GP stmt->setInt( 5, 0 ); // Mode - stmt->setInt( 6, 0 ); // Mount + stmt->setInt( 6, m_mount ); // Mount stmt->setInt( 7, 0 ); // InvicibleGM stmt->setInt( 8, m_voice ); diff --git a/src/servers/Server_Zone/Network/PacketWrappers/PlayerSpawnPacket.h b/src/servers/Server_Zone/Network/PacketWrappers/PlayerSpawnPacket.h index d0021978..859af3ad 100644 --- a/src/servers/Server_Zone/Network/PacketWrappers/PlayerSpawnPacket.h +++ b/src/servers/Server_Zone/Network/PacketWrappers/PlayerSpawnPacket.h @@ -72,7 +72,7 @@ namespace Server { m_data.title = pPlayer->getTitle(); m_data.voice = pPlayer->getVoiceId(); - m_data.currentMount = 0; + m_data.currentMount = pPlayer->getCurrentMount(); m_data.onlineStatus = static_cast< uint8_t >( pPlayer->getOnlineStatus() );