1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 21:49:55 +00:00

[Client] Revert c0d67f67fb after discovering its negative consequences

This commit is contained in:
David Cernat 2017-02-05 17:40:10 +02:00
parent cdd796aba1
commit 25d79dbcfe
2 changed files with 22 additions and 18 deletions

View file

@ -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();
}
}
}
}

View file

@ -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);