From 4c35c328a97b262303c5da560591f3eea2dc1361 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Mon, 1 May 2017 20:58:40 +0300 Subject: [PATCH] [Server] Add SendActorPosition() script function --- apps/openmw-mp/Script/Functions/Actors.cpp | 6 ++++++ apps/openmw-mp/Script/Functions/Actors.hpp | 2 ++ 2 files changed, 8 insertions(+) diff --git a/apps/openmw-mp/Script/Functions/Actors.cpp b/apps/openmw-mp/Script/Functions/Actors.cpp index 13a818a19..ae502677e 100644 --- a/apps/openmw-mp/Script/Functions/Actors.cpp +++ b/apps/openmw-mp/Script/Functions/Actors.cpp @@ -236,6 +236,12 @@ void ActorFunctions::SendActorAuthority() noexcept mwmp::Networking::get().getActorPacketController()->GetPacket(ID_ACTOR_AUTHORITY)->Send(writeActorList.guid); } +void ActorFunctions::SendActorPosition() noexcept +{ + mwmp::Networking::get().getActorPacketController()->GetPacket(ID_ACTOR_POSITION)->setActorList(&writeActorList); + mwmp::Networking::get().getActorPacketController()->GetPacket(ID_ACTOR_POSITION)->Send(writeActorList.guid); +} + void ActorFunctions::SendActorStatsDynamic() noexcept { mwmp::Networking::get().getActorPacketController()->GetPacket(ID_ACTOR_STATS_DYNAMIC)->setActorList(&writeActorList); diff --git a/apps/openmw-mp/Script/Functions/Actors.hpp b/apps/openmw-mp/Script/Functions/Actors.hpp index e1c4f41f3..b57c78826 100644 --- a/apps/openmw-mp/Script/Functions/Actors.hpp +++ b/apps/openmw-mp/Script/Functions/Actors.hpp @@ -53,6 +53,7 @@ \ {"SendActorList", ActorFunctions::SendActorList},\ {"SendActorAuthority", ActorFunctions::SendActorAuthority},\ + {"SendActorPosition", ActorFunctions::SendActorPosition},\ {"SendActorStatsDynamic", ActorFunctions::SendActorStatsDynamic},\ {"SendActorCellChange", ActorFunctions::SendActorCellChange} @@ -111,6 +112,7 @@ public: static void SendActorList() noexcept; static void SendActorAuthority() noexcept; + static void SendActorPosition() noexcept; static void SendActorStatsDynamic() noexcept; static void SendActorCellChange() noexcept; };