mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:23:51 +00:00
[Client] Send ObjectDelete for purchased objects removed from world
This commit is contained in:
parent
8e5859b466
commit
8b14c007f3
1 changed files with 17 additions and 0 deletions
|
@ -123,7 +123,24 @@ void ContainerItemModel::removeItem (const ItemStack& item, size_t count)
|
|||
{
|
||||
int refCount = source.getRefData().getCount();
|
||||
if (refCount - toRemove <= 0)
|
||||
{
|
||||
/*
|
||||
Start of tes3mp addition
|
||||
|
||||
Send an ID_OBJECT_DELETE packet every time an item is removed from the world
|
||||
because it has been purchased from its owner
|
||||
*/
|
||||
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
|
||||
objectList->reset();
|
||||
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
|
||||
objectList->addObjectDelete(source);
|
||||
objectList->sendObjectDelete();
|
||||
/*
|
||||
End of tes3mp addition
|
||||
*/
|
||||
|
||||
MWBase::Environment::get().getWorld()->deleteObject(source);
|
||||
}
|
||||
else
|
||||
source.getRefData().setCount(std::max(0, refCount - toRemove));
|
||||
toRemove -= refCount;
|
||||
|
|
Loading…
Reference in a new issue