From 6326991494726454be72acb3daf8213ff1e7e845 Mon Sep 17 00:00:00 2001 From: Mordred Date: Thu, 2 Dec 2021 00:08:33 +0100 Subject: [PATCH] Fixed inventory and gil --- src/world/Actor/PlayerInventory.cpp | 2 +- src/world/WorldServer.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/world/Actor/PlayerInventory.cpp b/src/world/Actor/PlayerInventory.cpp index f66a8fea6..fb8309717 100644 --- a/src/world/Actor/PlayerInventory.cpp +++ b/src/world/Actor/PlayerInventory.cpp @@ -522,7 +522,7 @@ void Sapphire::Entity::Player::writeInventory( InventoryType type ) query += "container_" + std::to_string( i ) + " = " + std::to_string( currItem ? currItem->getUId() : 0 ); } - query += " WHERE CharacterId = " + std::to_string( getId() ); + query += " WHERE CharacterId = " + std::to_string( getCharacterId() ); if( storage->isMultiStorage() ) query += " AND storageId = " + std::to_string( static_cast< uint16_t >( type ) ); diff --git a/src/world/WorldServer.cpp b/src/world/WorldServer.cpp index b7a9d310d..d46ef801d 100644 --- a/src/world/WorldServer.cpp +++ b/src/world/WorldServer.cpp @@ -611,8 +611,10 @@ Sapphire::Entity::PlayerPtr Sapphire::World::WorldServer::syncPlayer( uint64_t c // get db last write auto dbSync = pPlayer->getLastDBWrite(); + // db was updated and we lost track of it - update - if( dbSync != lastCacheSync ) + // @todo for now, always reload the player on login. + //if( dbSync != lastCacheSync ) { // clear current maps m_playerMapById[ pPlayer->getId() ] = nullptr;