1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 16:49:55 +00:00
openmw-tes3mp/components/openmw-mp/Packets/Player/PacketAttack.cpp

29 lines
794 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) : PlayerPacket(peer)
{
packetID = ID_GAME_ATTACK;
}
void PacketAttack::Packet(RakNet::BitStream *bs, mwmp::BasePlayer *player, bool send)
{
PlayerPacket::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);
}