diff --git a/apps/openmw/mwmp/Networking.cpp b/apps/openmw/mwmp/Networking.cpp index 69dd5ef86..1380349b6 100644 --- a/apps/openmw/mwmp/Networking.cpp +++ b/apps/openmw/mwmp/Networking.cpp @@ -633,7 +633,7 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet) WorldPacket *myPacket = worldController.GetPacket(packet->data[0]); WorldEvent *event = new WorldEvent(id); - MWWorld::CellStore *ptrCellStore = MWBase::Environment::get().getWorld()->getPlayerPtr().getCell(); + MWWorld::CellStore *ptrCellStore = MWBase::Environment::get().getWorld()->getCell(event->cellId); switch (packet->data[0]) { diff --git a/apps/openmw/mwworld/actiontake.cpp b/apps/openmw/mwworld/actiontake.cpp index b56492e38..8e2fa13e6 100644 --- a/apps/openmw/mwworld/actiontake.cpp +++ b/apps/openmw/mwworld/actiontake.cpp @@ -8,6 +8,8 @@ #include "../mwbase/windowmanager.hpp" #include "../mwbase/mechanicsmanager.hpp" +#include "../mwworld/cellstore.hpp" + #include "class.hpp" #include "containerstore.hpp" @@ -23,8 +25,8 @@ namespace MWWorld // Added by tes3mp mwmp::WorldEvent *event = mwmp::Main::get().getNetworking()->createWorldEvent(); - event->cellRef.blank(); + event->cellId = getTarget().getCell()->getCell()->getCellId(); event->cellRef.mRefID = getTarget().getCellRef().getRefId(); event->cellRef.mRefNum = getTarget().getCellRef().getRefNum(); mwmp::Main::get().getNetworking()->GetWorldPacket(ID_WORLD_OBJECT_DELETE)->Send(event); diff --git a/components/openmw-mp/Base/WorldEvent.hpp b/components/openmw-mp/Base/WorldEvent.hpp index c2a88ff80..05056a528 100644 --- a/components/openmw-mp/Base/WorldEvent.hpp +++ b/components/openmw-mp/Base/WorldEvent.hpp @@ -1,6 +1,7 @@ #ifndef OPENMW_WORLDEVENT_HPP #define OPENMW_WORLDEVENT_HPP +#include #include #include @@ -21,6 +22,8 @@ namespace mwmp } RakNet::RakNetGUID guid; + + ESM::CellId cellId; ESM::CellRef cellRef; }; } diff --git a/components/openmw-mp/Packets/World/PacketObjectDelete.cpp b/components/openmw-mp/Packets/World/PacketObjectDelete.cpp index d4432c6c9..25c252cd5 100644 --- a/components/openmw-mp/Packets/World/PacketObjectDelete.cpp +++ b/components/openmw-mp/Packets/World/PacketObjectDelete.cpp @@ -14,4 +14,9 @@ void PacketObjectDelete::Packet(RakNet::BitStream *bs, WorldEvent *event, bool s RW(event->cellRef.mRefID, send); RW(event->cellRef.mRefNum, send); + + RW(event->cellId.mPaged, send); + RW(event->cellId.mIndex.mX, send); + RW(event->cellId.mIndex.mY, send); + RW(event->cellId.mWorldspace, send); }