Tool getDigParams: Fix selecting the best fitting time
Previously, time was compared with result_time before dividing it by the level difference.
This commit is contained in:
parent
0d6b58a772
commit
d7c1f6c92e
@ -200,11 +200,12 @@ DigParams getDigParams(const ItemGroupList &groups,
|
|||||||
int rating = itemgroup_get(groups, name);
|
int rating = itemgroup_get(groups, name);
|
||||||
float time = 0;
|
float time = 0;
|
||||||
bool time_exists = cap.getTime(rating, &time);
|
bool time_exists = cap.getTime(rating, &time);
|
||||||
|
int leveldiff = cap.maxlevel - level;
|
||||||
|
time /= MYMAX(1, leveldiff);
|
||||||
if(!result_diggable || time < result_time){
|
if(!result_diggable || time < result_time){
|
||||||
if(cap.maxlevel >= level && time_exists){
|
if(cap.maxlevel >= level && time_exists){
|
||||||
result_diggable = true;
|
result_diggable = true;
|
||||||
int leveldiff = cap.maxlevel - level;
|
result_time = time;
|
||||||
result_time = time / MYMAX(1, leveldiff);
|
|
||||||
if(cap.uses != 0)
|
if(cap.uses != 0)
|
||||||
result_wear = 1.0 / cap.uses / pow(3.0, (double)leveldiff);
|
result_wear = 1.0 / cap.uses / pow(3.0, (double)leveldiff);
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user