diff --git a/src/items.zig b/src/items.zig index ccb8dc23..41b2c3d1 100644 --- a/src/items.zig +++ b/src/items.zig @@ -358,7 +358,6 @@ const ToolPhysics = struct { // MARK: ToolPhysics sum *= property.resultScale; tool.getProperty(property.destination orelse continue).* += sum; } - if(tool.maxDurability < 1) tool.maxDurability = 1; if(tool.damage < 1) tool.damage = 1/(2 - tool.damage); if(tool.swingTime < 1) tool.swingTime = 1/(2 - tool.swingTime); for(0..25) |i| { @@ -384,7 +383,9 @@ const ToolPhysics = struct { // MARK: ToolPhysics mod.changeToolParameters(tool); } - tool.durability = @max(1, std.math.lossyCast(u32, tool.maxDurability)); + tool.maxDurability = @round(tool.maxDurability); + if(tool.maxDurability < 1) tool.maxDurability = 1; + tool.durability = std.math.lossyCast(u32, tool.maxDurability); } };