Fix missing include and guard functions with network macro

This commit is contained in:
ZehMatt committed 2021-08-11 22:15:36 +03:00
1 parent 1848dd7839
commit 53c5519cb3
2 files changed
+13 -11

No files matched your search

@@ -12,8 +12,8 @@
#ifdef ENABLE_SCRIPTING
# include "../../../Cheats.h"
# include "../../Duktape.hpp"
# include "../../ScriptEngine.h"
# include "Duktape.hpp"
namespace OpenRCT2::Scripting
{
@@ -50,6 +50,7 @@ namespace OpenRCT2::Scripting
# endif
}
# ifndef DISABLE_NETWORK
static std::string TransformPermissionKeyToJS(const std::string& s)
{
auto result = s.substr(sizeof("PERMISSION_") - 1);
@@ -60,6 +61,17 @@ namespace OpenRCT2::Scripting
return result;
}
static std::string TransformPermissionKeyToInternal(const std::string& s)
{
auto result = "PERMISSION_" + s;
for (auto& c : result)
{
c = std::toupper(c);
}
return result;
}
# endif
std::vector<std::string> ScPlayerGroup::permissions_get() const
{
# ifndef DISABLE_NETWORK
@@ -84,16 +96,6 @@ namespace OpenRCT2::Scripting
# endif
}
static std::string TransformPermissionKeyToInternal(const std::string& s)
{
auto result = "PERMISSION_" + s;
for (auto& c : result)
{
c = std::toupper(c);
}
return result;
}
void ScPlayerGroup::permissions_set(std::vector<std::string> value)
{
# ifndef DISABLE_NETWORK