Send CellId in ID_WORLD_OBJECT_DELETE

coverity_scan^2
David Cernat 8 years ago
parent 2e57e25675
commit 103b1e3f72

@ -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])
{

@ -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);

@ -1,6 +1,7 @@
#ifndef OPENMW_WORLDEVENT_HPP
#define OPENMW_WORLDEVENT_HPP
#include <components/esm/cellid.hpp>
#include <components/esm/cellref.hpp>
#include <RakNetTypes.h>
@ -21,6 +22,8 @@ namespace mwmp
}
RakNet::RakNetGUID guid;
ESM::CellId cellId;
ESM::CellRef cellRef;
};
}

@ -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);
}

Loading…
Cancel
Save