mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-25 19:17:45 +00:00
load stats after inventory
This commit is contained in:
parent
cf9e5eba85
commit
55e0367a2a
1 changed files with 7 additions and 13 deletions
|
@ -121,13 +121,6 @@ bool Sapphire::Entity::Player::load( uint32_t charId, World::SessionPtr pSession
|
|||
setRot( 0.0f );
|
||||
}
|
||||
|
||||
// Stats
|
||||
|
||||
m_hp = res->getUInt( "Hp" );
|
||||
m_mp = res->getUInt( "Mp" );
|
||||
m_tp = 0;
|
||||
|
||||
|
||||
// Model
|
||||
auto custom = res->getBlobVector( "Customize" );
|
||||
memcpy( reinterpret_cast< char* >( m_customize ), custom.data(), custom.size() );
|
||||
|
@ -209,6 +202,13 @@ bool Sapphire::Entity::Player::load( uint32_t charId, World::SessionPtr pSession
|
|||
if( !loadActiveQuests() || !loadClassData() || !loadSearchInfo() || !loadHuntingLog() )
|
||||
Logger::error( "Player #{0} data corrupt!", char_id_str );
|
||||
|
||||
initInventory();
|
||||
calculateStats();
|
||||
|
||||
// Stats
|
||||
m_hp = res->getUInt( "Hp" );
|
||||
m_mp = res->getUInt( "Mp" );
|
||||
m_tp = 0;
|
||||
m_maxHp = getMaxHp();
|
||||
m_maxMp = getMaxMp();
|
||||
|
||||
|
@ -217,12 +217,6 @@ bool Sapphire::Entity::Player::load( uint32_t charId, World::SessionPtr pSession
|
|||
m_modelSubWeapon = 0;
|
||||
m_lastTickTime = 0;
|
||||
|
||||
//m_pInventory->load();
|
||||
|
||||
initInventory(); // moved up so we don't lose hp every login
|
||||
|
||||
calculateStats();
|
||||
|
||||
// first login, run the script event
|
||||
if( m_bNewGame )
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue