mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Change ContentFeatures array to a vector
This commit is contained in:
parent
9733dd5b5e
commit
112dbba7c4
7 changed files with 162 additions and 115 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue