From cdd796aba11bdef9db62dca49214e48f30231cc0 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Sun, 5 Feb 2017 16:14:26 +0200 Subject: [PATCH] [Client] Send ID_PLAYER_INVENTORY from two more locations --- apps/openmw/mwgui/hud.cpp | 5 +++++ apps/openmw/mwscript/containerextensions.cpp | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/apps/openmw/mwgui/hud.cpp b/apps/openmw/mwgui/hud.cpp index f3e56c572..7b51a2a02 100644 --- a/apps/openmw/mwgui/hud.cpp +++ b/apps/openmw/mwgui/hud.cpp @@ -291,6 +291,8 @@ namespace MWGui WorldItemModel drop (mouseX, mouseY); mDragAndDrop->drop(&drop, NULL); + // Added by tes3mp + // // LocalPlayer's inventory has changed, so send a packet with it mwmp::Main::get().getLocalPlayer()->sendInventory(); @@ -326,6 +328,9 @@ namespace MWGui 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(); } } } diff --git a/apps/openmw/mwscript/containerextensions.cpp b/apps/openmw/mwscript/containerextensions.cpp index 0b4c9a0fc..277710487 100644 --- a/apps/openmw/mwscript/containerextensions.cpp +++ b/apps/openmw/mwscript/containerextensions.cpp @@ -6,6 +6,9 @@ #include +#include "../mwmp/Main.hpp" +#include "../mwmp/LocalPlayer.hpp" + #include #include @@ -67,6 +70,11 @@ namespace MWScript // Spawn a messagebox (only for items added to player's inventory and if player is talking to someone) if (ptr == MWBase::Environment::get().getWorld ()->getPlayerPtr() ) { + // Added by tes3mp + // + // LocalPlayer's inventory has changed, so send a packet with it + mwmp::Main::get().getLocalPlayer()->sendInventory(); + // The two GMST entries below expand to strings informing the player of what, and how many of it has been added to their inventory std::string msgBox; std::string itemName = itemPtr.getClass().getName(itemPtr);