mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
Avoid some inefficiencies when handling ItemStack(Metadata)
This commit is contained in:
parent
d884a1624f
commit
a2058f7f3a
7 changed files with 37 additions and 51 deletions
|
@ -1594,7 +1594,7 @@ ToolCapabilities read_tool_capabilities(
|
|||
// key at index -2 and value at index -1
|
||||
int rating = luaL_checkinteger(L, -2);
|
||||
float time = luaL_checknumber(L, -1);
|
||||
groupcap.times[rating] = time;
|
||||
groupcap.times.emplace_back(rating, time);
|
||||
// removes value, keeps key for next iteration
|
||||
lua_pop(L, 1);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue