diff --git a/apps/openmw-mp/Script/Functions/World.cpp b/apps/openmw-mp/Script/Functions/World.cpp index 8d7ffb266..ac70aa234 100644 --- a/apps/openmw-mp/Script/Functions/World.cpp +++ b/apps/openmw-mp/Script/Functions/World.cpp @@ -45,6 +45,11 @@ int WorldFunctions::GetObjectRefNumIndex(unsigned int i) noexcept return mwmp::Networking::getPtr()->getLastEvent()->objectChanges.objects.at(i).refNumIndex; } +int WorldFunctions::GetObjectMpNum(unsigned int i) noexcept +{ + return mwmp::Networking::getPtr()->getLastEvent()->objectChanges.objects.at(i).mpNum; +} + int WorldFunctions::GetObjectCount(unsigned int i) noexcept { return mwmp::Networking::getPtr()->getLastEvent()->objectChanges.objects.at(i).count; @@ -172,6 +177,11 @@ void WorldFunctions::SetObjectRefNumIndex(int refNumIndex) noexcept tempWorldObject.refNumIndex = refNumIndex; } +void WorldFunctions::SetObjectMpNum(int mpNum) noexcept +{ + tempWorldObject.mpNum = mpNum; +} + void WorldFunctions::SetObjectCount(int count) noexcept { tempWorldObject.count = count; diff --git a/apps/openmw-mp/Script/Functions/World.hpp b/apps/openmw-mp/Script/Functions/World.hpp index d8f9664bf..2abee743f 100644 --- a/apps/openmw-mp/Script/Functions/World.hpp +++ b/apps/openmw-mp/Script/Functions/World.hpp @@ -9,6 +9,7 @@ \ {"GetObjectRefId", WorldFunctions::GetObjectRefId},\ {"GetObjectRefNumIndex", WorldFunctions::GetObjectRefNumIndex},\ + {"GetObjectMpNum", WorldFunctions::GetObjectMpNum},\ {"GetObjectCount", WorldFunctions::GetObjectCount},\ {"GetObjectCharge", WorldFunctions::GetObjectCharge},\ {"GetObjectGoldValue", WorldFunctions::GetObjectGoldValue},\ @@ -33,6 +34,7 @@ \ {"SetObjectRefId", WorldFunctions::SetObjectRefId},\ {"SetObjectRefNumIndex", WorldFunctions::SetObjectRefNumIndex},\ + {"SetObjectMpNum", WorldFunctions::SetObjectMpNum},\ {"SetObjectCount", WorldFunctions::SetObjectCount},\ {"SetObjectCharge", WorldFunctions::SetObjectCharge},\ {"SetObjectGoldValue", WorldFunctions::SetObjectGoldValue},\ @@ -72,6 +74,7 @@ public: static const char *GetObjectRefId(unsigned int i) noexcept; static int GetObjectRefNumIndex(unsigned int i) noexcept; + static int GetObjectMpNum(unsigned int i) noexcept; static int GetObjectCount(unsigned int i) noexcept; static int GetObjectCharge(unsigned int i) noexcept; static int GetObjectGoldValue(unsigned int i) noexcept; @@ -96,6 +99,7 @@ public: static void SetObjectRefId(const char* refId) noexcept; static void SetObjectRefNumIndex(int refNumIndex) noexcept; + static void SetObjectMpNum(int mpNum) noexcept; static void SetObjectCount(int count) noexcept; static void SetObjectCharge(int charge) noexcept; static void SetObjectGoldValue(int goldValue) noexcept;