From fb0ab850891ad345d75c32fd9c161ed1bf9a18ee Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Thu, 29 Jun 2023 05:58:24 +1000 Subject: Lua: player.* identity getters and setters --- source/core/StarLua.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source/core/StarLua.hpp') diff --git a/source/core/StarLua.hpp b/source/core/StarLua.hpp index 9241ec4..2c108ef 100644 --- a/source/core/StarLua.hpp +++ b/source/core/StarLua.hpp @@ -9,6 +9,7 @@ #include "StarString.hpp" #include "StarJson.hpp" #include "StarRefPtr.hpp" +#include "StarDirectives.hpp" namespace Star { @@ -825,6 +826,16 @@ struct LuaConverter { } }; +template <> +struct LuaConverter { + static LuaValue from(LuaEngine& engine, Directives const& v) { + if (String const* ptr = v.stringPtr()) + return engine.createString(*ptr); + else + return engine.createString(""); + } +}; + template <> struct LuaConverter { static LuaValue from(LuaEngine&, LuaString v) { -- cgit v1.2.3