From e01cadad23531db89ef1c344575d1974beebf21a Mon Sep 17 00:00:00 2001 From: David Cernat Date: Wed, 3 May 2017 04:45:55 +0300 Subject: [PATCH] [Server] Send ActorAuthority packets to all players who loaded the cell --- apps/openmw-mp/Script/Functions/Actors.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/openmw-mp/Script/Functions/Actors.cpp b/apps/openmw-mp/Script/Functions/Actors.cpp index ae502677e..319526784 100644 --- a/apps/openmw-mp/Script/Functions/Actors.cpp +++ b/apps/openmw-mp/Script/Functions/Actors.cpp @@ -232,8 +232,15 @@ void ActorFunctions::SendActorList() noexcept void ActorFunctions::SendActorAuthority() noexcept { - mwmp::Networking::get().getActorPacketController()->GetPacket(ID_ACTOR_AUTHORITY)->setActorList(&writeActorList); - mwmp::Networking::get().getActorPacketController()->GetPacket(ID_ACTOR_AUTHORITY)->Send(writeActorList.guid); + mwmp::ActorPacket *authorityPacket = mwmp::Networking::get().getActorPacketController()->GetPacket(ID_ACTOR_AUTHORITY); + authorityPacket->setActorList(&writeActorList); + authorityPacket->Send(writeActorList.guid); + + // Also send this to everyone else who has the cell loaded + Cell *serverCell = CellController::get()->getCell(&writeActorList.cell); + + if (serverCell != nullptr) + serverCell->sendToLoaded(authorityPacket, &writeActorList); } void ActorFunctions::SendActorPosition() noexcept