Skip to content
Permalink
Browse files

Tool getDigParams: Fix selecting the best fitting time

Previously, time was compared with result_time before dividing it by
the level difference.
  • Loading branch information...
HybridDog authored and paramat committed Apr 19, 2017
1 parent 0d6b58a commit d7c1f6c92ec612a13850f0aa58c3541c9a1e19c1
Showing with 3 additions and 2 deletions.
  1. +3 −2 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

0 comments on commit d7c1f6c

Please sign in to comment.
You can’t perform that action at this time.