diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-02-27 23:28:45 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-03-02 18:12:17 +0100 |
commit | 05bb880a3b0ebe401bac83b7a2400aa315161f9c (patch) | |
tree | 2699643270ff24fb1d454bc8154357dff68d1968 /src/scripting/luascript.cpp | |
parent | a36e231883d595bcba91d44e19f24b31eaf0431b (diff) | |
download | manaserv-05bb880a3b0ebe401bac83b7a2400aa315161f9c.tar.gz manaserv-05bb880a3b0ebe401bac83b7a2400aa315161f9c.tar.bz2 manaserv-05bb880a3b0ebe401bac83b7a2400aa315161f9c.tar.xz manaserv-05bb880a3b0ebe401bac83b7a2400aa315161f9c.zip |
Simplified some of the Lua backend
Mainly introduced a helper function for getting to the Script instance for
the current Lua state.
Reviewed-by: Erik Schilling
Reviewed-by: Yohann Ferreira
Diffstat (limited to 'src/scripting/luascript.cpp')
-rw-r--r-- | src/scripting/luascript.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/scripting/luascript.cpp b/src/scripting/luascript.cpp index af9da17b..c487aa67 100644 --- a/src/scripting/luascript.cpp +++ b/src/scripting/luascript.cpp @@ -80,10 +80,8 @@ void LuaScript::push(const std::list<InventoryItem> &itemList) std::map<std::string, int> item; item["id"] = i->itemId; item["amount"] = i->amount; - // add the item structure to the item table under the next index - lua_pushinteger(mState, ++position); pushSTLContainer<std::string, int>(mState, item); - lua_settable(mState, itemTable); + lua_rawseti(mState, itemTable, ++position); } ++nbArgs; } |