1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-08 19:57:46 +00:00

Set FirstClass properly

This commit is contained in:
Lucy 2023-02-11 17:20:21 +01:00
parent 595795d3b0
commit 5f04ef60ef
4 changed files with 12 additions and 1 deletions

View file

@ -690,6 +690,11 @@ uint8_t Player::getLevelForClass( Common::ClassJob pClass ) const
return static_cast< uint8_t >( m_classArray[ classJobIndex ] );
}
Common::ClassJob Player::getFirstClass() const
{
return m_firstClass;
}
bool Player::isClassJobUnlocked( Common::ClassJob classJob ) const
{
// todo: need to properly check if a job is unlocked, at the moment we just check the class array which will return true for every job if the base class is unlocked

View file

@ -214,6 +214,9 @@ namespace Sapphire::Entity
/*! returns the level of the provided class / job */
uint8_t getLevelForClass( Common::ClassJob pClass ) const;
/*! \return the first class of the player */
Common::ClassJob getFirstClass() const;
/*! returns if the classjob is unlocked */
bool isClassJobUnlocked( Common::ClassJob classJob ) const;
@ -901,6 +904,8 @@ namespace Sapphire::Entity
ExpList m_expArray{};
StateFlags m_stateFlags{};
Common::ClassJob m_firstClass{};
uint8_t m_homePoint;
uint8_t m_startTown;
uint16_t m_townWarpFstFlags;

View file

@ -78,6 +78,7 @@ bool Sapphire::Entity::Player::loadFromDb( uint64_t characterId )
m_class = static_cast< ClassJob >( res->getUInt( "Class" ) );
m_homePoint = res->getUInt8( "Homepoint" );
m_firstClass = static_cast< ClassJob >( res->getUInt( "FirstClass" ) );
// Additional data
m_voice = res->getUInt8( "Voice" );

View file

@ -34,7 +34,7 @@ namespace Sapphire::Network::Packets::WorldPackets::Server
m_data.Tribe = player.getLookAt( Common::CharaLook::Tribe );
m_data.Sex = player.getLookAt( Common::CharaLook::Gender );
m_data.ClassJob = static_cast< uint8_t >( player.getClass() );
m_data.FirstClass = static_cast< uint8_t >( player.getClass() );
m_data.FirstClass = static_cast< uint8_t >( player.getFirstClass() );
//m_data.maxLevel = player.getLevel();
m_data.GuardianDeity = static_cast< uint8_t >( player.getGuardianDeity() );
m_data.BirthMonth = player.getBirthMonth();