2017-05-29 01:43:52 +00:00
|
|
|
#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;
|
|
|
|
}
|
|
|
|
|
2017-06-02 19:42:10 +00:00
|
|
|
void PacketActorAI::Actor(BaseActor &actor, bool send)
|
2017-05-29 01:43:52 +00:00
|
|
|
{
|
2018-05-12 03:29:11 +00:00
|
|
|
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, 1);
|
|
|
|
RW(actor.aiTarget.refNumIndex, send);
|
|
|
|
RW(actor.aiTarget.mpNum, send);
|
|
|
|
}
|
|
|
|
}
|
2017-05-29 01:43:52 +00:00
|
|
|
}
|