Perfect blockHit and correct value result #2864
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This small problem was present for a long time and apparently nobody cares, since no one else plans to fix it, I have done it for you to support this engine to be more perfect every time.
With this change there will no longer be a difference between an object that protects 50% or two objects that protect 25% + 25%
If you test the sources prior to this change, you will notice that the results are different and mathematically wrong.
TEST VISUAL
Lua Example:
local damage50 = 1000
damage50 = damage50 - (damage50 / 100 * 50)
print(damage50)
local damage2525 = 1000
damage2525 = damage2525 - (damage2525 / 100 * 25)
damage2525 = damage2525 - (damage2525 / 100 * 25)
print(damage2525)
-- Print 500 <-- 50%
-- Print 562.5 <--- 25% + 25%