From 920c1113a3c53d5ffec6602d3c69e2c5f587e961 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Sun, 29 Jan 2017 16:16:01 +0200 Subject: [PATCH] [Server] Add script functions for setting world object placement info --- apps/openmw-mp/Script/Functions/World.cpp | 10 ++++++++++ apps/openmw-mp/Script/Functions/World.hpp | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/apps/openmw-mp/Script/Functions/World.cpp b/apps/openmw-mp/Script/Functions/World.cpp index b25986319..aa2290c53 100644 --- a/apps/openmw-mp/Script/Functions/World.cpp +++ b/apps/openmw-mp/Script/Functions/World.cpp @@ -61,6 +61,16 @@ void WorldFunctions::SetObjectRefNumIndex(unsigned int i, int refNumIndex) noexc worldEvent->objectChanges.objects[i].refNumIndex = refNumIndex; } +void WorldFunctions::SetObjectCount(unsigned int i, int count) noexcept +{ + worldEvent->objectChanges.objects[i].count = count; +} + +void WorldFunctions::SetObjectGoldValue(unsigned int i, int goldValue) noexcept +{ + worldEvent->objectChanges.objects[i].goldValue = goldValue; +} + void WorldFunctions::SetObjectPosition(unsigned int i, double x, double y, double z) noexcept { worldEvent->objectChanges.objects[i].pos.pos[0] = x; diff --git a/apps/openmw-mp/Script/Functions/World.hpp b/apps/openmw-mp/Script/Functions/World.hpp index ed771235c..77f473ac1 100644 --- a/apps/openmw-mp/Script/Functions/World.hpp +++ b/apps/openmw-mp/Script/Functions/World.hpp @@ -9,6 +9,8 @@ \ {"SetObjectRefId", WorldFunctions::SetObjectRefId},\ {"SetObjectRefNumIndex", WorldFunctions::SetObjectRefNumIndex},\ + {"SetObjectCount", WorldFunctions::SetObjectCount},\ + {"SetObjectGoldValue", WorldFunctions::SetObjectGoldValue},\ {"SetObjectPosition", WorldFunctions::SetObjectPosition},\ \ {"GetObjectChangesSize", WorldFunctions::GetObjectChangesSize},\ @@ -39,6 +41,8 @@ public: static void SetObjectRefId(unsigned int i, const char* refId) noexcept; static void SetObjectRefNumIndex(unsigned int i, int refNumIndex) noexcept; + 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 unsigned int GetObjectChangesSize() noexcept;