mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-08-03 11:17:05 -04:00
Round max durability and move durability clamping after modifiers.
fixes #1370
This commit is contained in:
parent
c7d938e965
commit
b08aff096c
@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user