diff options
author | Kahrl <kahrl@gmx.net> | 2013-08-11 04:09:45 +0200 |
---|---|---|
committer | Kahrl <kahrl@gmx.net> | 2013-08-14 21:03:33 +0200 |
commit | 4e1f50035e860a00636ca5d804c267119df99601 (patch) | |
tree | c6cab522305ef2a5b9cfdb3685340d57590f1ff1 /src/script/lua_api/l_nodemeta.cpp | |
parent | 6228d634fb31d1ce925d1fdc2dac022629a007ef (diff) | |
download | minetest-4e1f50035e860a00636ca5d804c267119df99601.tar.gz minetest-4e1f50035e860a00636ca5d804c267119df99601.tar.bz2 minetest-4e1f50035e860a00636ca5d804c267119df99601.zip |
Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenu
Diffstat (limited to 'src/script/lua_api/l_nodemeta.cpp')
-rw-r--r-- | src/script/lua_api/l_nodemeta.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/script/lua_api/l_nodemeta.cpp b/src/script/lua_api/l_nodemeta.cpp index 511fb38ce..f9c8794d5 100644 --- a/src/script/lua_api/l_nodemeta.cpp +++ b/src/script/lua_api/l_nodemeta.cpp @@ -17,13 +17,15 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "cpp_api/scriptapi.h" +#include "lua_api/l_nodemeta.h" +#include "lua_api/l_internal.h" +#include "lua_api/l_inventory.h" #include "common/c_converter.h" #include "common/c_content.h" +#include "environment.h" #include "map.h" -#include "lua_api/l_nodemeta.h" -#include "common/c_internal.h" -#include "lua_api/l_inventory.h" +#include "nodemetadata.h" + /* @@ -211,7 +213,7 @@ int NodeMetaRef::l_to_table(lua_State *L) std::vector<const InventoryList*> lists = inv->getLists(); for(std::vector<const InventoryList*>::const_iterator i = lists.begin(); i != lists.end(); i++){ - push_inventory_list(inv, (*i)->getName().c_str(), L); + push_inventory_list(L, inv, (*i)->getName().c_str()); lua_setfield(L, -2, (*i)->getName().c_str()); } } @@ -257,7 +259,7 @@ int NodeMetaRef::l_from_table(lua_State *L) while(lua_next(L, inventorytable) != 0){ // key at index -2 and value at index -1 std::string name = lua_tostring(L, -2); - read_inventory_list(inv, name.c_str(), L, -1,STACK_TO_SERVER(L)); + read_inventory_list(L, -1, inv, name.c_str(), getServer(L)); lua_pop(L, 1); // removes value, keeps key for next iteration } reportMetadataChange(ref); @@ -328,5 +330,3 @@ const luaL_reg NodeMetaRef::methods[] = { luamethod(NodeMetaRef, from_table), {0,0} }; - -REGISTER_LUA_REF(NodeMetaRef); |