2018-07-05 19:24:51 +00:00
|
|
|
#include "PacketPlayerDeath.hpp"
|
|
|
|
#include <components/openmw-mp/NetworkMessages.hpp>
|
|
|
|
|
|
|
|
using namespace mwmp;
|
|
|
|
|
|
|
|
PacketPlayerDeath::PacketPlayerDeath(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
|
|
|
|
{
|
|
|
|
packetID = ID_PLAYER_DEATH;
|
|
|
|
}
|
|
|
|
|
2019-12-04 08:17:33 +00:00
|
|
|
void PacketPlayerDeath::Packet(RakNet::BitStream *newBitstream, bool send)
|
2018-07-05 19:24:51 +00:00
|
|
|
{
|
2019-12-04 08:17:33 +00:00
|
|
|
PlayerPacket::Packet(newBitstream, send);
|
2018-07-05 19:24:51 +00:00
|
|
|
|
2019-11-29 10:52:47 +00:00
|
|
|
RW(player->deathState, send);
|
2018-07-05 19:24:51 +00:00
|
|
|
RW(player->killer.isPlayer, send);
|
|
|
|
|
|
|
|
if (player->killer.isPlayer)
|
|
|
|
{
|
|
|
|
RW(player->killer.guid, send);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
RW(player->killer.refId, send, true);
|
2018-07-13 01:12:03 +00:00
|
|
|
RW(player->killer.refNum, send);
|
2018-07-05 19:24:51 +00:00
|
|
|
RW(player->killer.mpNum, send);
|
|
|
|
|
|
|
|
RW(player->killer.name, send, true);
|
|
|
|
}
|
|
|
|
}
|