mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Make getStackMax return the correct maximal stack size
This commit is contained in:
parent
aa33166386
commit
2de8c22a99
3 changed files with 5 additions and 7 deletions
|
@ -65,9 +65,8 @@ ItemDefinition read_item_definition(lua_State* L,int index,
|
|||
}
|
||||
lua_pop(L, 1);
|
||||
|
||||
def.stack_max = getintfield_default(L, index, "stack_max", def.stack_max);
|
||||
if(def.stack_max == 0)
|
||||
def.stack_max = 1;
|
||||
int stack_max = getintfield_default(L, index, "stack_max", def.stack_max);
|
||||
def.stack_max = rangelim(stack_max, 1, U16_MAX);
|
||||
|
||||
lua_getfield(L, index, "on_use");
|
||||
def.usable = lua_isfunction(L, -1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue