1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 02:49:55 +00:00
openmw-tes3mp/components/openmw-mp/Packets/Actor/PacketActorAttack.cpp
David Cernat 09da24f1ea [General] Rename all instances of refNumIndex into refNum
This creates symmetry with mpNum and should cause less confusion in the future.
2018-07-13 04:12:03 +03:00

39 lines
1 KiB
C++

#include <components/openmw-mp/NetworkMessages.hpp>
#include <components/openmw-mp/Log.hpp>
#include "PacketActorAttack.hpp"
using namespace mwmp;
PacketActorAttack::PacketActorAttack(RakNet::RakPeerInterface *peer) : ActorPacket(peer)
{
packetID = ID_ACTOR_ATTACK;
}
void PacketActorAttack::Actor(BaseActor &actor, bool send)
{
RW(actor.attack.target.isPlayer, send);
if (actor.attack.target.isPlayer)
{
RW(actor.attack.target.guid, send);
}
else
{
RW(actor.attack.target.refId, send, true);
RW(actor.attack.target.refNum, send);
RW(actor.attack.target.mpNum, send);
}
RW(actor.attack.spellId, send);
RW(actor.attack.type, send);
RW(actor.attack.success, send);
RW(actor.attack.damage, send);
RW(actor.attack.pressed, send);
RW(actor.attack.knockdown, send);
RW(actor.attack.block, send);
RW(actor.attack.instant, send);
RW(actor.attack.applyWeaponEnchantment, send);
RW(actor.attack.applyProjectileEnchantment, send);
}