openmw-tes3coop/components/openmw-mp/Packets/Actor/PacketActorEquipment.cpp
David Cernat b9520c11da [General] Rework PlayerEquipment packets so they are of minimal size
Moreover, rename BaseNetCreature's equipedItems into equipmentItems.

(cherry picked from commit d1ad0c91f8)
2018-04-20 22:46:16 +03:00

21 lines
588 B
C++

#include <components/openmw-mp/NetworkMessages.hpp>
#include <components/openmw-mp/Log.hpp>
#include "PacketActorEquipment.hpp"
using namespace mwmp;
PacketActorEquipment::PacketActorEquipment(RakNet::RakPeerInterface *peer) : ActorPacket(peer)
{
packetID = ID_ACTOR_EQUIPMENT;
}
void PacketActorEquipment::Actor(BaseActor &actor, bool send)
{
for (auto &&equipmentItem : actor.equipmentItems)
{
RW(equipmentItem.refId, send);
RW(equipmentItem.count, send);
RW(equipmentItem.charge, send);
RW(equipmentItem.enchantmentCharge, send);
}
}