mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 00:49:54 +00:00
09da24f1ea
This creates symmetry with mpNum and should cause less confusion in the future.
35 lines
862 B
C++
35 lines
862 B
C++
#include <components/openmw-mp/NetworkMessages.hpp>
|
|
#include "PacketObjectSpawn.hpp"
|
|
|
|
using namespace mwmp;
|
|
|
|
PacketObjectSpawn::PacketObjectSpawn(RakNet::RakPeerInterface *peer) : ObjectPacket(peer)
|
|
{
|
|
packetID = ID_OBJECT_SPAWN;
|
|
hasCellData = true;
|
|
}
|
|
|
|
void PacketObjectSpawn::Object(BaseObject &baseObject, bool send)
|
|
{
|
|
ObjectPacket::Object(baseObject, send);
|
|
RW(baseObject.position, send);
|
|
RW(baseObject.summonDuration, send);
|
|
|
|
RW(baseObject.isSummon, send);
|
|
|
|
if (baseObject.isSummon)
|
|
{
|
|
RW(baseObject.master.isPlayer, send);
|
|
|
|
if (baseObject.master.isPlayer)
|
|
{
|
|
RW(baseObject.master.guid, send);
|
|
}
|
|
else
|
|
{
|
|
RW(baseObject.master.refId, send, true);
|
|
RW(baseObject.master.refNum, send);
|
|
RW(baseObject.master.mpNum, send);
|
|
}
|
|
}
|
|
}
|