mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 19:19:56 +00:00
[Client] Revert c0d67f67fb
after discovering its negative consequences
This commit is contained in:
parent
cdd796aba1
commit
25d79dbcfe
2 changed files with 22 additions and 18 deletions
|
@ -313,25 +313,7 @@ namespace MWGui
|
|||
{
|
||||
// pick up object
|
||||
if (!object.isEmpty())
|
||||
{
|
||||
MWBase::Environment::get().getWindowManager()->getInventoryWindow()->pickUpObject(object);
|
||||
|
||||
// Added by tes3mp
|
||||
mwmp::LocalEvent *event = mwmp::Main::get().getNetworking()->createLocalEvent();
|
||||
event->cell = *object.getCell()->getCell();
|
||||
|
||||
mwmp::WorldObject worldObject;
|
||||
worldObject.refId = object.getCellRef().getRefId();
|
||||
worldObject.refNumIndex = object.getCellRef().getRefNum().mIndex;
|
||||
event->addObject(worldObject);
|
||||
|
||||
mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_DELETE)->Send(event);
|
||||
delete event;
|
||||
event = nullptr;
|
||||
|
||||
// LocalPlayer's inventory has changed, so send a packet with it
|
||||
mwmp::Main::get().getLocalPlayer()->sendInventory();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,6 +16,12 @@
|
|||
|
||||
#include <components/settings/settings.hpp>
|
||||
|
||||
#include "../mwmp/Main.hpp"
|
||||
#include "../mwmp/Networking.hpp"
|
||||
#include "../mwmp/LocalEvent.hpp"
|
||||
#include "../mwmp/LocalPlayer.hpp"
|
||||
#include "../mwworld/cellstore.hpp"
|
||||
|
||||
#include "../mwbase/world.hpp"
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/soundmanager.hpp"
|
||||
|
@ -629,6 +635,22 @@ namespace MWGui
|
|||
// can't use ActionTake here because we need an MWWorld::Ptr to the newly inserted object
|
||||
MWWorld::Ptr newObject = *player.getClass().getContainerStore (player).add (object, object.getRefData().getCount(), player);
|
||||
|
||||
// Added by tes3mp
|
||||
mwmp::LocalEvent *event = mwmp::Main::get().getNetworking()->createLocalEvent();
|
||||
event->cell = *object.getCell()->getCell();
|
||||
|
||||
mwmp::WorldObject worldObject;
|
||||
worldObject.refId = object.getCellRef().getRefId();
|
||||
worldObject.refNumIndex = object.getCellRef().getRefNum().mIndex;
|
||||
event->addObject(worldObject);
|
||||
|
||||
mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_DELETE)->Send(event);
|
||||
delete event;
|
||||
event = nullptr;
|
||||
|
||||
// LocalPlayer's inventory has changed, so send a packet with it
|
||||
mwmp::Main::get().getLocalPlayer()->sendInventory();
|
||||
|
||||
// remove from world
|
||||
MWBase::Environment::get().getWorld()->deleteObject (object);
|
||||
|
||||
|
|
Loading…
Reference in a new issue