diff --git a/apps/openmw-mp/Script/Functions/Miscellaneous.cpp b/apps/openmw-mp/Script/Functions/Miscellaneous.cpp index df8b70748..180c5bf18 100644 --- a/apps/openmw-mp/Script/Functions/Miscellaneous.cpp +++ b/apps/openmw-mp/Script/Functions/Miscellaneous.cpp @@ -11,6 +11,16 @@ unsigned int MiscellaneousFunctions::GetLastPlayerId() noexcept return Players::getLastPlayerId(); } +int MiscellaneousFunctions::GetCurrentMpNum() noexcept +{ + return mwmp::Networking::getPtr()->getCurrentMpNum(); +} + +void MiscellaneousFunctions::SetCurrentMpNum(int mpNum) noexcept +{ + mwmp::Networking::getPtr()->setCurrentMpNum(mpNum); +} + void MiscellaneousFunctions::LogMessage(unsigned short level, const char *message) noexcept { LOG_MESSAGE_SIMPLE(level, "[Script]: %s", message); diff --git a/apps/openmw-mp/Script/Functions/Miscellaneous.hpp b/apps/openmw-mp/Script/Functions/Miscellaneous.hpp index 668659515..063692d76 100644 --- a/apps/openmw-mp/Script/Functions/Miscellaneous.hpp +++ b/apps/openmw-mp/Script/Functions/Miscellaneous.hpp @@ -6,6 +6,9 @@ #define MISCELLANEOUSAPI \ {"GetLastPlayerId", MiscellaneousFunctions::GetLastPlayerId},\ \ + {"GetCurrentMpNum", MiscellaneousFunctions::GetCurrentMpNum},\ + {"SetCurrentMpNum", MiscellaneousFunctions::SetCurrentMpNum},\ + | {"LogMessage", MiscellaneousFunctions::LogMessage},\ {"LogAppend", MiscellaneousFunctions::LogAppend} @@ -14,6 +17,9 @@ class MiscellaneousFunctions public: static unsigned int GetLastPlayerId() noexcept; + static int GetCurrentMpNum() noexcept; + static void SetCurrentMpNum(int mpNum) noexcept; + static void LogMessage(unsigned short level, const char *message) noexcept; static void LogAppend(unsigned short level, const char *message) noexcept; };