Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/game/scripting/StarRootLuaBindings.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2024-12-10 18:49:29 +1100
committerKae <80987908+Novaenia@users.noreply.github.com>2024-12-10 18:49:29 +1100
commitd95eac316405fb100963d47dcd95ccced3462383 (patch)
tree8229a98c4b96cbd4268c5ceb02f3a3b5754a6daa /source/game/scripting/StarRootLuaBindings.cpp
parentdd52188e53e690f8eb872421f8a4c3bcc5699133 (diff)
Input: binds can now make the clipboard available while held, config option to always allow
Diffstat (limited to 'source/game/scripting/StarRootLuaBindings.cpp')
-rw-r--r--source/game/scripting/StarRootLuaBindings.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/game/scripting/StarRootLuaBindings.cpp b/source/game/scripting/StarRootLuaBindings.cpp
index e1d7e3e..d87b423 100644
--- a/source/game/scripting/StarRootLuaBindings.cpp
+++ b/source/game/scripting/StarRootLuaBindings.cpp
@@ -230,7 +230,7 @@ LuaCallbacks LuaBindings::makeRootCallbacks() {
});
callbacks.registerCallback("setConfiguration", [root](String const& key, Json const& value) {
- if (key == "safeScripts")
+ if (key == "safeScripts" || key == "safe")
throw StarException(strf("Cannot set {}", key));
else
root->configuration()->set(key, value);
@@ -245,7 +245,7 @@ LuaCallbacks LuaBindings::makeRootCallbacks() {
});
callbacks.registerCallback("setConfigurationPath", [root](String const& path, Json const& value) {
- if (path.empty() || path.beginsWith("safeScripts"))
+ if (path.empty() || path.beginsWith("safeScripts") || path.splitAny("[].").get(0) == "safe")
throw ConfigurationException(strf("cannot set {}", path));
else
root->configuration()->setPath(path, value);