1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 18:19:55 +00:00

[Client] Send ActorAI packet for new cell after being followed to it

This commit is contained in:
David Cernat 2018-07-13 22:34:36 +03:00
parent 528bd26a3b
commit cc9e294cc0

View file

@ -11,6 +11,7 @@
#include "../mwmp/Networking.hpp"
#include "../mwmp/ActorList.hpp"
#include "../mwmp/CellController.hpp"
#include "../mwmp/MechanicsHelper.hpp"
/*
End of tes3mp addition
*/
@ -112,6 +113,10 @@ namespace MWWorld
Send ActorCellChange packets when an actor follows us across cells, regardless of
whether we're the cell authority or not; the server can decide if it wants to comply
with them
Afterwards, send an ActorAI packet about this actor being our follower, to ensure
they remain our follower even if the destination cell has another player as its
cell authority
*/
mwmp::BaseActor baseActor;
baseActor.refNum = actor.getCellRef().getRefNum().mIndex;
@ -132,6 +137,13 @@ namespace MWWorld
actorList->addCellChangeActor(baseActor);
actorList->sendCellChangeActors();
// Send ActorAI to bring all players in the new cell up to speed with this follower
actorList->cell = baseActor.cell;
baseActor.aiAction = mwmp::BaseActorList::FOLLOW;
baseActor.aiTarget = MechanicsHelper::getTarget(world->getPlayerPtr());
actorList->addAiActor(baseActor);
actorList->sendAiActors();
/*
End of tes3mp addition
*/