mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 10:03:45 +01:00
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);
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user