[Client] Send ID_PLAYER_INVENTORY upon dropping an item

pull/163/head
David Cernat 8 years ago
parent ecc456fea9
commit f03724be7b

@ -3,6 +3,7 @@
#include "../mwmp/Main.hpp"
#include "../mwmp/Networking.hpp"
#include "../mwmp/LocalEvent.hpp"
#include "../mwmp/LocalPlayer.hpp"
#include "../mwworld/cellstore.hpp"
#include <MyGUI_RenderManager.h>
@ -87,6 +88,8 @@ namespace MWGui
event->addObject(worldObject);
// LocalPlayer's inventory has changed, so send a packet with it
mwmp::Main::get().getLocalPlayer()->sendInventory();
mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_PLACE)->Send(event);
LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Sending ID_OBJECT_PLACE\n- cellRef: %s, %i\n- count: %i",

@ -50,16 +50,19 @@ void LocalEvent::placeObjects(MWWorld::CellStore* cellStore)
{
worldObject = objectChanges.objects[i];
LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s\n- count: %i",
LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s\n- charge: %i\n- count: %i",
worldObject.refId.c_str(),
worldObject.refNumIndex,
cell.getDescription().c_str(),
worldObject.charge,
worldObject.count);
MWWorld::ManualRef ref(MWBase::Environment::get().getWorld()->getStore(), worldObject.refId, 1);
MWWorld::Ptr newPtr = ref.getPtr();
newPtr.getCellRef().setCharge(worldObject.charge);
if (worldObject.charge > -1)
newPtr.getCellRef().setCharge(worldObject.charge);
if (worldObject.count > 1)
newPtr.getRefData().setCount(worldObject.count);

Loading…
Cancel
Save