From 0273931e4ca5e0009c688199deadaa13de0a51d1 Mon Sep 17 00:00:00 2001 From: collett Date: Tue, 12 May 2020 02:57:13 +0900 Subject: [PATCH 1/2] delete sold item from db --- src/world/Actor/Player.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/world/Actor/Player.cpp b/src/world/Actor/Player.cpp index 15c30e93..2027633c 100644 --- a/src/world/Actor/Player.cpp +++ b/src/world/Actor/Player.cpp @@ -2259,6 +2259,13 @@ void Sapphire::Entity::Player::addBuyBackItemForShop( uint32_t shopId, const Sap void Sapphire::Entity::Player::clearBuyBackMap() { + for( auto& list : m_shopBuyBackMap ) + { + for( auto& entry : list.second ) + { + deleteItemDb( entry.item ); + } + } m_shopBuyBackMap.clear(); } From 302d06c038692fd2690b55345fadcddb40478057 Mon Sep 17 00:00:00 2001 From: collett Date: Tue, 12 May 2020 03:06:04 +0900 Subject: [PATCH 2/2] also when logout --- src/world/Session.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/world/Session.cpp b/src/world/Session.cpp index 56bcc888..b446f293 100644 --- a/src/world/Session.cpp +++ b/src/world/Session.cpp @@ -72,6 +72,7 @@ void Sapphire::World::Session::close() // remove the session from the player if( m_pPlayer ) { + m_pPlayer->clearBuyBackMap(); // do one last update to db m_pPlayer->updateSql(); // reset the zone, so the zone handler knows to remove the actor