1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 00:49:54 +00:00
openmw-tes3mp/components/openmw-mp/Packets/PacketAttack.cpp
2016-07-07 23:50:48 +08:00

29 lines
790 B
C++

//
// Created by koncord on 13.01.16.
//
#include <components/openmw-mp/NetworkMessages.hpp>
#include "PacketAttack.hpp"
using namespace mwmp;
PacketAttack::PacketAttack(RakNet::RakPeerInterface *peer) : BasePacket(peer)
{
packetID = ID_GAME_ATTACK;
}
void PacketAttack::Packet(RakNet::BitStream *bs, mwmp::BasePlayer *player, bool send)
{
BasePacket::Packet(bs, player, send);
RW(player->GetAttack()->attacker, send);
RW(player->GetAttack()->target, send);
RW(player->GetAttack()->refid, send);
RW(player->GetAttack()->type, send);
RW(player->GetAttack()->success, send);
RW(player->GetAttack()->damage, send);
//
RW(player->GetAttack()->pressed, send);
RW(player->GetAttack()->knockdown, send);
RW(player->GetAttack()->block, send);
}