From d7c1f6c92ec612a13850f0aa58c3541c9a1e19c1 Mon Sep 17 00:00:00 2001 From: Hybrid Dog Date: Wed, 19 Apr 2017 20:55:47 +0200 Subject: [PATCH] Tool getDigParams: Fix selecting the best fitting time Previously, time was compared with result_time before dividing it by the level difference. --- src/tool.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tool.cpp b/src/tool.cpp index 2d2f9dee5..7128f1915 100644 --- a/src/tool.cpp +++ b/src/tool.cpp @@ -200,11 +200,12 @@ DigParams getDigParams(const ItemGroupList &groups, int rating = itemgroup_get(groups, name); float time = 0; bool time_exists = cap.getTime(rating, &time); + int leveldiff = cap.maxlevel - level; + time /= MYMAX(1, leveldiff); if(!result_diggable || time < result_time){ if(cap.maxlevel >= level && time_exists){ result_diggable = true; - int leveldiff = cap.maxlevel - level; - result_time = time / MYMAX(1, leveldiff); + result_time = time; if(cap.uses != 0) result_wear = 1.0 / cap.uses / pow(3.0, (double)leveldiff); else -- 2.25.1