diff --git a/apps/openmw-mp/Script/Functions/World.cpp b/apps/openmw-mp/Script/Functions/World.cpp index aa2290c53..85fb1071f 100644 --- a/apps/openmw-mp/Script/Functions/World.cpp +++ b/apps/openmw-mp/Script/Functions/World.cpp @@ -78,6 +78,13 @@ void WorldFunctions::SetObjectPosition(unsigned int i, double x, double y, doubl worldEvent->objectChanges.objects[i].pos.pos[2] = z; } +void WorldFunctions::SetObjectRotation(unsigned int i, double x, double y, double z) noexcept +{ + worldEvent->objectChanges.objects[i].pos.rot[0] = x; + worldEvent->objectChanges.objects[i].pos.rot[1] = y; + worldEvent->objectChanges.objects[i].pos.rot[2] = z; +} + unsigned int WorldFunctions::GetObjectChangesSize() noexcept { return mwmp::Networking::getPtr()->getLastEvent()->objectChanges.count; @@ -118,6 +125,21 @@ double WorldFunctions::GetObjectPosZ(unsigned int i) noexcept return mwmp::Networking::getPtr()->getLastEvent()->objectChanges.objects[i].pos.pos[2]; } +double WorldFunctions::GetObjectRotX(unsigned int i) noexcept +{ + return mwmp::Networking::getPtr()->getLastEvent()->objectChanges.objects[i].pos.rot[0]; +} + +double WorldFunctions::GetObjectRotY(unsigned int i) noexcept +{ + return mwmp::Networking::getPtr()->getLastEvent()->objectChanges.objects[i].pos.rot[1]; +} + +double WorldFunctions::GetObjectRotZ(unsigned int i) noexcept +{ + return mwmp::Networking::getPtr()->getLastEvent()->objectChanges.objects[i].pos.rot[2]; +} + void WorldFunctions::SendObjectDelete() noexcept { mwmp::Networking::get().getWorldController()->GetPacket(ID_OBJECT_DELETE)->Send(worldEvent, worldEvent->guid); diff --git a/apps/openmw-mp/Script/Functions/World.hpp b/apps/openmw-mp/Script/Functions/World.hpp index 77f473ac1..e9803cc48 100644 --- a/apps/openmw-mp/Script/Functions/World.hpp +++ b/apps/openmw-mp/Script/Functions/World.hpp @@ -12,6 +12,7 @@ {"SetObjectCount", WorldFunctions::SetObjectCount},\ {"SetObjectGoldValue", WorldFunctions::SetObjectGoldValue},\ {"SetObjectPosition", WorldFunctions::SetObjectPosition},\ + {"SetObjectRotation", WorldFunctions::SetObjectRotation},\ \ {"GetObjectChangesSize", WorldFunctions::GetObjectChangesSize},\ \ @@ -22,6 +23,9 @@ {"GetObjectPosX", WorldFunctions::GetObjectPosX},\ {"GetObjectPosY", WorldFunctions::GetObjectPosY},\ {"GetObjectPosZ", WorldFunctions::GetObjectPosZ},\ + {"GetObjectRotX", WorldFunctions::GetObjectRotX},\ + {"GetObjectRotY", WorldFunctions::GetObjectRotY},\ + {"GetObjectRotZ", WorldFunctions::GetObjectRotZ},\ \ {"SendObjectDelete", WorldFunctions::SendObjectDelete},\ {"SendObjectPlace", WorldFunctions::SendObjectPlace},\ @@ -44,6 +48,7 @@ public: static void SetObjectCount(unsigned int i, int count) noexcept; static void SetObjectGoldValue(unsigned int i, int goldValue) noexcept; static void SetObjectPosition(unsigned int i, double x, double y, double z) noexcept; + static void SetObjectRotation(unsigned int i, double x, double y, double z) noexcept; static unsigned int GetObjectChangesSize() noexcept; @@ -54,6 +59,9 @@ public: static double GetObjectPosX(unsigned int i) noexcept; static double GetObjectPosY(unsigned int i) noexcept; static double GetObjectPosZ(unsigned int i) noexcept; + static double GetObjectRotX(unsigned int i) noexcept; + static double GetObjectRotY(unsigned int i) noexcept; + static double GetObjectRotZ(unsigned int i) noexcept; static void SendObjectDelete() noexcept; static void SendObjectPlace() noexcept;