1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 17:19:56 +00:00
openmw-tes3mp/components/openmw-mp/Packets/World/PacketObjectSpawn.cpp
2017-06-03 03:10:47 +08:00

25 lines
630 B
C++

#include <components/openmw-mp/NetworkMessages.hpp>
#include "PacketObjectSpawn.hpp"
using namespace mwmp;
PacketObjectSpawn::PacketObjectSpawn(RakNet::RakPeerInterface *peer) : WorldPacket(peer)
{
packetID = ID_OBJECT_SPAWN;
hasCellData = true;
}
void PacketObjectSpawn::Object(WorldObject &worldObject, bool send)
{
WorldPacket::Object(worldObject, send);
RW(worldObject.position, send);
RW(worldObject.hasMaster, send);
if (worldObject.hasMaster)
{
RW(worldObject.master.refNumIndex, send);
RW(worldObject.master.mpNum, send);
RW(worldObject.master.guid, send);
}
}