You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All custom hoes (those registered with the game API) with a high uses count are also affected
The error increases the higher the number of uses (up to tens of thausands).
Reason for this bug
This is basically minetest/minetest#4900, but in Minetest Game. The same mistake is done as was done in the engine: The naive calculation add_wear(65535/(uses-1)) that is currently used won't always get in the number of uses you want due to rounding errors. The larger the number of desired uses, the larger the rounding error is (see #11110 for an in-depth analysis).
Possible fix
Merge minetest/minetest#12047 into Minetest, then replace the naive wear calculation with item:add_wear_by_uses(number_of_uses_that_you_want_the_tool_to_have_before_it_breaks). ;-)
This is a helper function made specifically for this use case.
The text was updated successfully, but these errors were encountered:
The hoe usage count is off.
The error increases the higher the number of uses (up to tens of thausands).
Reason for this bug
This is basically minetest/minetest#4900, but in Minetest Game. The same mistake is done as was done in the engine: The naive calculation
add_wear(65535/(uses-1))
that is currently used won't always get in the number of uses you want due to rounding errors. The larger the number of desired uses, the larger the rounding error is (see #11110 for an in-depth analysis).Possible fix
Merge minetest/minetest#12047 into Minetest, then replace the naive wear calculation with
item:add_wear_by_uses(number_of_uses_that_you_want_the_tool_to_have_before_it_breaks)
. ;-)This is a helper function made specifically for this use case.
The text was updated successfully, but these errors were encountered: