From 345e1041a204ca9d40a25b71ae239ce3275f0755 Mon Sep 17 00:00:00 2001 From: Hybrid Dog Date: Mon, 10 Apr 2017 20:03:53 +0200 Subject: [PATCH] Tool.cpp/.h, lua_api/l_util.cpp: Tidy up code and remove dead code --- src/script/lua_api/l_util.cpp | 8 ++--- src/tool.cpp | 65 ++++++++++++++--------------------- src/tool.h | 3 -- 3 files changed, 27 insertions(+), 49 deletions(-) diff --git a/src/script/lua_api/l_util.cpp b/src/script/lua_api/l_util.cpp index 839c4be11..501261dd7 100644 --- a/src/script/lua_api/l_util.cpp +++ b/src/script/lua_api/l_util.cpp @@ -158,18 +158,14 @@ int ModApiUtil::l_write_json(lua_State *L) return 1; } -// get_dig_params(groups, tool_capabilities[, time_from_last_punch]) +// get_dig_params(groups, tool_capabilities) int ModApiUtil::l_get_dig_params(lua_State *L) { NO_MAP_LOCK_REQUIRED; ItemGroupList groups; read_groups(L, 1, groups); ToolCapabilities tp = read_tool_capabilities(L, 2); - if(lua_isnoneornil(L, 3)) - push_dig_params(L, getDigParams(groups, &tp)); - else - push_dig_params(L, getDigParams(groups, &tp, - luaL_checknumber(L, 3))); + push_dig_params(L, getDigParams(groups, &tp)); return 1; } diff --git a/src/tool.cpp b/src/tool.cpp index 7128f1915..568f0af54 100644 --- a/src/tool.cpp +++ b/src/tool.cpp @@ -170,16 +170,13 @@ void ToolCapabilities::deserializeJson(std::istream &is) } DigParams getDigParams(const ItemGroupList &groups, - const ToolCapabilities *tp, float time_from_last_punch) + const ToolCapabilities *tp) { - //infostream<<"getDigParams"<