mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-26 22:37:45 +00:00
Merge pull request #672 from collett8192/shop_update
delete sold item from db
This commit is contained in:
commit
fb8d4e9794
2 changed files with 8 additions and 0 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue