diff --git a/apps/openmw/mwgui/hud.cpp b/apps/openmw/mwgui/hud.cpp index 95cea6918..fb9e19c56 100644 --- a/apps/openmw/mwgui/hud.cpp +++ b/apps/openmw/mwgui/hud.cpp @@ -68,7 +68,10 @@ namespace MWGui event->cell = *dropped.getCell()->getCell(); event->cellRef.mRefID = dropped.getCellRef().getRefId(); event->cellRef.mRefNum = dropped.getCellRef().getRefNum(); - event->cellRef.mPos = dropped.getCellRef().getPosition(); + + // Make sure we send the RefData position instead of the CellRef one, because that's what + // we actually see on this client + event->pos = dropped.getRefData().getPosition(); // We have to get the count from the dropped object because it gets changed // automatically for stacks of gold diff --git a/apps/openmw/mwmp/Networking.cpp b/apps/openmw/mwmp/Networking.cpp index d1eaef391..02a2b3ecd 100644 --- a/apps/openmw/mwmp/Networking.cpp +++ b/apps/openmw/mwmp/Networking.cpp @@ -719,7 +719,7 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet) newPtr.getCellRef().setGoldValue(event->cellRef.mGoldValue); - newPtr = MWBase::Environment::get().getWorld()->placeObject(newPtr, ptrCellStore, event->cellRef.mPos); + newPtr = MWBase::Environment::get().getWorld()->placeObject(newPtr, ptrCellStore, event->pos); // Change RefNum here because the line above unsets it newPtr.getCellRef().setRefNumIndex(event->cellRef.mRefNum.mIndex); diff --git a/apps/openmw/mwscript/transformationextensions.cpp b/apps/openmw/mwscript/transformationextensions.cpp index 256cd42f4..a73ce6aa6 100644 --- a/apps/openmw/mwscript/transformationextensions.cpp +++ b/apps/openmw/mwscript/transformationextensions.cpp @@ -549,7 +549,11 @@ namespace MWScript event->cell = *ptr.getCell()->getCell(); event->cellRef.mRefID = ptr.getCellRef().getRefId(); event->cellRef.mRefNum = ptr.getCellRef().getRefNum(); - event->cellRef.mPos = ptr.getCellRef().getPosition(); + + // Make sure we send the RefData position instead of the CellRef one, because that's what + // we actually see on this client + event->pos = ptr.getRefData().getPosition(); + event->count = 1; mwmp::Main::get().getNetworking()->GetWorldPacket(ID_OBJECT_PLACE)->Send(event); diff --git a/components/openmw-mp/Packets/World/PacketObjectPlace.cpp b/components/openmw-mp/Packets/World/PacketObjectPlace.cpp index 8a94c9f1e..b806f1ff9 100644 --- a/components/openmw-mp/Packets/World/PacketObjectPlace.cpp +++ b/components/openmw-mp/Packets/World/PacketObjectPlace.cpp @@ -14,7 +14,6 @@ void PacketObjectPlace::Packet(RakNet::BitStream *bs, WorldEvent *event, bool se RW(event->cellRef.mRefID, send); RW(event->cellRef.mRefNum.mIndex, send); - RW(event->cellRef.mPos, send); RW(event->cellRef.mGoldValue, send); RW(event->cell.mData.mFlags, send); @@ -22,5 +21,6 @@ void PacketObjectPlace::Packet(RakNet::BitStream *bs, WorldEvent *event, bool se RW(event->cell.mData.mY, send); RW(event->cell.mName, send); + RW(event->pos, send); RW(event->count, send); }