Round tool stats display to 1 decimal#2872
Round tool stats display to 1 decimal#2872GasSpace630 wants to merge 1 commit intoPixelGuys:masterfrom
Conversation
IntegratedQuantum
left a comment
There was a problem hiding this comment.
Also please rebase, there was a refactor that affects this.
2069748 to
591efd6
Compare
| proceduralItem.getProperty(property.destination orelse continue).* += sum; | ||
| } | ||
| if (proceduralItem.damage < 1) proceduralItem.damage = 1/(2 - proceduralItem.damage); | ||
| if (proceduralItem.swingSpeed < 1) proceduralItem.swingSpeed = 1/(2 - proceduralItem.swingSpeed); |
There was a problem hiding this comment.
Why did you remove this? This is required to prevent negative values.
|
also CI failed, please run the formatter |
IntegratedQuantum
left a comment
There was a problem hiding this comment.
Now you are only applying rounding to small and negative values, and they remain negative.
| proceduralItem.getProperty(property.destination orelse continue).* += sum; | ||
| } | ||
| if (proceduralItem.damage < 1) proceduralItem.damage = 1/(2 - proceduralItem.damage); | ||
| if (proceduralItem.swingSpeed < 1) proceduralItem.swingSpeed = 1/(2 - proceduralItem.swingSpeed); |
There was a problem hiding this comment.
I'm asking you again: Why did you remove the old checks?
There was a problem hiding this comment.
dont worry i did because it would reduce noise and maybe make the stats cleaner
and about the negative values
at line:509 it just clamps it to 0.1
i can change this if this isnt the desired behavoiur.
There was a problem hiding this comment.
The reason for this code to exist was to allow negative values and let them still impact the stats, even for large negative values. A clamp does not allow this.
There was a problem hiding this comment.
Ohh... i didnt know we wanted -ve values, my bad 😅
There was a problem hiding this comment.
wait so if we have -ve value for damage does that heal the enemy?
IntegratedQuantum
left a comment
There was a problem hiding this comment.
Please apply fixes after #2891
1b502ac to
c4eaaae
Compare
|
What you've done now is remove the code that rounds the actual values, instead of fixing it up with #2891. I am annoyed by how many times I've had to review this PR, so I decided to quickly do this myself in 8b4d843 For the future I suggest to learn how to use |

This PR replaces #2871 which fixes #2696
The previous PR contained unrelated changes, so it was closed.
This version only includes the formatting changes.