1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-17 03:53:07 +01:00

Fix missing include and guard functions with network macro

This commit is contained in:
ZehMatt
2021-08-09 22:22:01 +03:00
parent 1848dd7839
commit 53c5519cb3
2 changed files with 13 additions and 11 deletions

View File

@@ -12,8 +12,8 @@
#ifdef ENABLE_SCRIPTING
# include "../../../Cheats.h"
# include "../../Duktape.hpp"
# include "../../ScriptEngine.h"
# include "Duktape.hpp"
namespace OpenRCT2::Scripting
{

View File

@@ -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