1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-20 09:53:51 +00:00
openmw-tes3mp/components/openmw-mp/Packets/Object/PacketObjectSpawn.cpp

36 lines
866 B
C++
Raw Normal View History

#include <components/openmw-mp/NetworkMessages.hpp>
#include "PacketObjectSpawn.hpp"
using namespace mwmp;
PacketObjectSpawn::PacketObjectSpawn(RakNet::RakPeerInterface *peer) : ObjectPacket(peer)
{
packetID = ID_OBJECT_SPAWN;
2017-06-02 19:10:47 +00:00
hasCellData = true;
}
void PacketObjectSpawn::Object(BaseObject &baseObject, bool send)
{
ObjectPacket::Object(baseObject, send);
RW(baseObject.position, send);
RW(baseObject.summonDuration, send);
RW(baseObject.hasMaster, send);
if (baseObject.hasMaster)
{
RW(baseObject.master.isPlayer, send);
if (baseObject.master.isPlayer)
{
RW(baseObject.master.guid, send);
}
else
{
RW(baseObject.master.refId, send, 1);
RW(baseObject.master.refNumIndex, send);
RW(baseObject.master.mpNum, send);
}
}
}