mirror of
https://github.com/minetest/minetest.git
synced 2024-12-24 23:22:24 +01:00
Fix get_tool_wear_after_use for one use (insta-break) (#12945)
This commit is contained in:
parent
042f7917e7
commit
88b04eadc9
@ -166,8 +166,8 @@ int ModApiUtil::l_get_tool_wear_after_use(lua_State *L)
|
|||||||
NO_MAP_LOCK_REQUIRED;
|
NO_MAP_LOCK_REQUIRED;
|
||||||
u32 uses = readParam<int>(L, 1);
|
u32 uses = readParam<int>(L, 1);
|
||||||
u16 initial_wear = readParam<int>(L, 2, 0);
|
u16 initial_wear = readParam<int>(L, 2, 0);
|
||||||
u16 wear = calculateResultWear(uses, initial_wear);
|
u32 add_wear = calculateResultWear(uses, initial_wear);
|
||||||
lua_pushnumber(L, wear);
|
lua_pushnumber(L, add_wear);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user