mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-20 01:51:06 +01:00
Fix #990
This commit is contained in:
parent
088f2eecae
commit
3d7e89811d
1 changed files with 3 additions and 2 deletions
|
@ -384,10 +384,11 @@ local function xp_step(self, dtime)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
uses = uses or 0
|
uses = uses or 0
|
||||||
local repair = (65536 / uses) * xp * 2
|
local multiplier = 2 * 65535 / uses
|
||||||
|
local repair = xp * multiplier
|
||||||
local new_wear = wear - repair
|
local new_wear = wear - repair
|
||||||
if new_wear < 0 then
|
if new_wear < 0 then
|
||||||
xp = math.floor(-new_wear / 2)
|
xp = math.floor(-new_wear / multiplier + 0.5)
|
||||||
new_wear = 0
|
new_wear = 0
|
||||||
else
|
else
|
||||||
xp = 0
|
xp = 0
|
||||||
|
|
Loading…
Reference in a new issue