From 18bf79e08bb8bd0e41c83158d263300d9dfd985c Mon Sep 17 00:00:00 2001 From: David Cernat Date: Fri, 9 Jun 2017 13:31:19 +0300 Subject: [PATCH] [Client] Correctly set mpNum for placed gold --- apps/openmw/mwmp/WorldEvent.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwmp/WorldEvent.cpp b/apps/openmw/mwmp/WorldEvent.cpp index 0fcaa0fe3..6bf33dd58 100644 --- a/apps/openmw/mwmp/WorldEvent.cpp +++ b/apps/openmw/mwmp/WorldEvent.cpp @@ -176,10 +176,11 @@ void WorldEvent::placeObjects(MWWorld::CellStore* cellStore) if (worldObject.count > 1) newPtr.getRefData().setCount(worldObject.count); - newPtr.getCellRef().setMpNum(worldObject.mpNum); - newPtr.getCellRef().setGoldValue(worldObject.goldValue); newPtr = MWBase::Environment::get().getWorld()->placeObject(newPtr, cellStore, worldObject.position); + + // Because gold automatically gets replaced with a new object, make sure we set the mpNum at the end + newPtr.getCellRef().setMpNum(worldObject.mpNum); } else { @@ -790,8 +791,8 @@ void WorldEvent::sendObjectPlace() { mwmp::WorldObject worldObject = (*it); - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s-%i, count: %i", - worldObject.refId.c_str(), worldObject.refNumIndex, worldObject.count); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, count: %i", + worldObject.refId.c_str(), worldObject.count); } mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_PLACE)->setEvent(this);