diff options
author | Kahrl <kahrl@gmx.net> | 2013-07-14 00:55:47 +0200 |
---|---|---|
committer | Kahrl <kahrl@gmx.net> | 2013-07-14 23:06:31 +0200 |
commit | 112dbba7c4d38bf780e4e2f05bdff106b52ce2f9 (patch) | |
tree | 7fbe8695a950726a2b178cd6a012430d0d42e211 /src/script/lua_api | |
parent | 9733dd5b5e5516e18775665db132b2446492716c (diff) | |
download | minetest-112dbba7c4d38bf780e4e2f05bdff106b52ce2f9.tar.gz minetest-112dbba7c4d38bf780e4e2f05bdff106b52ce2f9.tar.bz2 minetest-112dbba7c4d38bf780e4e2f05bdff106b52ce2f9.zip |
Change ContentFeatures array to a vector
Diffstat (limited to 'src/script/lua_api')
-rw-r--r-- | src/script/lua_api/l_item.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/script/lua_api/l_item.cpp b/src/script/lua_api/l_item.cpp index 4069c61ce..6182c037b 100644 --- a/src/script/lua_api/l_item.cpp +++ b/src/script/lua_api/l_item.cpp @@ -432,10 +432,15 @@ int ModApiItemMod::l_register_item_raw(lua_State *L) idef->registerItem(def); // Read the node definition (content features) and register it - if(def.type == ITEM_NODE) - { + if(def.type == ITEM_NODE){ ContentFeatures f = read_content_features(L, table); - ndef->set(f.name, f); + content_t id = ndef->set(f.name, f); + + if(id > MAX_REGISTERED_CONTENT){ + throw LuaError(L, "Number of registerable nodes (" + + itos(MAX_REGISTERED_CONTENT+1) + + ") exceeded (" + name + ")"); + } } return 0; /* number of results */ |