From 0b3e29dea9863c4b5ca0c77958bbcb32a05867ca Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 14 Feb 2015 23:12:07 +0100 Subject: Some work towards scriptable events --- src/model/ScriptValue.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/model/ScriptValue.hpp') diff --git a/src/model/ScriptValue.hpp b/src/model/ScriptValue.hpp index a82ba8e..04c4e55 100644 --- a/src/model/ScriptValue.hpp +++ b/src/model/ScriptValue.hpp @@ -116,13 +116,13 @@ public: class ScriptTable : public ScriptValue { public: - typedef std::unordered_map> MapType; + typedef std::unordered_map, std::shared_ptr> MapType; private: MapType value; public: - std::shared_ptr & operator[](const std::string &key) { + std::shared_ptr & operator[](const std::shared_ptr &key) { return value[key]; } @@ -130,7 +130,7 @@ public: lua_createtable(L, 0, value.size()); for (const auto &entry : value) { - lua_pushstring(L, entry.first.c_str()); + entry.first->push(L); entry.second->push(L); lua_settable(L, -3); -- cgit v1.2.3