1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-27 14:57:44 +00:00

Merge pull request #672 from collett8192/shop_update

delete sold item from db
This commit is contained in:
Mordred 2020-05-12 00:18:19 +02:00 committed by GitHub
commit fb8d4e9794
2 changed files with 8 additions and 0 deletions

View file

@ -2259,6 +2259,13 @@ void Sapphire::Entity::Player::addBuyBackItemForShop( uint32_t shopId, const Sap
void Sapphire::Entity::Player::clearBuyBackMap() void Sapphire::Entity::Player::clearBuyBackMap()
{ {
for( auto& list : m_shopBuyBackMap )
{
for( auto& entry : list.second )
{
deleteItemDb( entry.item );
}
}
m_shopBuyBackMap.clear(); m_shopBuyBackMap.clear();
} }

View file

@ -72,6 +72,7 @@ void Sapphire::World::Session::close()
// remove the session from the player // remove the session from the player
if( m_pPlayer ) if( m_pPlayer )
{ {
m_pPlayer->clearBuyBackMap();
// do one last update to db // do one last update to db
m_pPlayer->updateSql(); m_pPlayer->updateSql();
// reset the zone, so the zone handler knows to remove the actor // reset the zone, so the zone handler knows to remove the actor