From 88b04eadc9b37d44940ccb409f3af18d1cf248ed Mon Sep 17 00:00:00 2001 From: Gregor Parzefall <82708541+grorp@users.noreply.github.com> Date: Wed, 9 Nov 2022 17:58:53 +0100 Subject: [PATCH] Fix get_tool_wear_after_use for one use (insta-break) (#12945) --- src/script/lua_api/l_util.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/script/lua_api/l_util.cpp b/src/script/lua_api/l_util.cpp index bf2bb9137..d24d070ca 100644 --- a/src/script/lua_api/l_util.cpp +++ b/src/script/lua_api/l_util.cpp @@ -166,8 +166,8 @@ int ModApiUtil::l_get_tool_wear_after_use(lua_State *L) NO_MAP_LOCK_REQUIRED; u32 uses = readParam(L, 1); u16 initial_wear = readParam(L, 2, 0); - u16 wear = calculateResultWear(uses, initial_wear); - lua_pushnumber(L, wear); + u32 add_wear = calculateResultWear(uses, initial_wear); + lua_pushnumber(L, add_wear); return 1; }