mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-24 22:53:51 +00:00
30 lines
665 B
C++
30 lines
665 B
C++
|
#include "PacketPlayerDeath.hpp"
|
||
|
#include <components/openmw-mp/NetworkMessages.hpp>
|
||
|
|
||
|
using namespace mwmp;
|
||
|
|
||
|
PacketPlayerDeath::PacketPlayerDeath(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
|
||
|
{
|
||
|
packetID = ID_PLAYER_DEATH;
|
||
|
}
|
||
|
|
||
|
void PacketPlayerDeath::Packet(RakNet::BitStream *bs, bool send)
|
||
|
{
|
||
|
PlayerPacket::Packet(bs, send);
|
||
|
|
||
|
RW(player->killer.isPlayer, send);
|
||
|
|
||
|
if (player->killer.isPlayer)
|
||
|
{
|
||
|
RW(player->killer.guid, send);
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
RW(player->killer.refId, send, true);
|
||
|
RW(player->killer.refNumIndex, send);
|
||
|
RW(player->killer.mpNum, send);
|
||
|
|
||
|
RW(player->killer.name, send, true);
|
||
|
}
|
||
|
}
|