openmw-tes3coop/components/openmw-mp/Packets/Actor/PacketActorAI.cpp
Koncord 23684489da [General] Fix clang-tidy warning
Converting integer literal to bool, use bool literal instead
2018-07-03 02:50:21 +08:00

32 lines
742 B
C++

#include <components/openmw-mp/NetworkMessages.hpp>
#include <components/openmw-mp/Log.hpp>
#include "PacketActorAI.hpp"
using namespace mwmp;
PacketActorAI::PacketActorAI(RakNet::RakPeerInterface *peer) : ActorPacket(peer)
{
packetID = ID_ACTOR_AI;
}
void PacketActorAI::Actor(BaseActor &actor, bool send)
{
RW(actor.aiAction, send);
RW(actor.hasAiTarget, send);
if (actor.hasAiTarget)
{
RW(actor.aiTarget.isPlayer, send);
if (actor.aiTarget.isPlayer)
{
RW(actor.aiTarget.guid, send);
}
else
{
RW(actor.aiTarget.refId, send, true);
RW(actor.aiTarget.refNumIndex, send);
RW(actor.aiTarget.mpNum, send);
}
}
}