Conversation
src/game/common/rts/player.cpp
Outdated
| if (killer != nullptr && killed != nullptr && !killed->Get_Status(OBJECT_STATUS_UNDER_CONSTRUCTION)) { | ||
| unsigned int amount = | ||
| GameMath::Fast_To_Int_Ceil(killed->Get_Template()->Calc_Cost_To_Build(this) * m_bountyCostToBuild); | ||
| GameMath::Fast_To_Int_Floor(killed->Get_Template()->Calc_Cost_To_Build(this) * m_bountyCostToBuild); |
There was a problem hiding this comment.
Fast_To_Int_Ceil was correct
There was a problem hiding this comment.
Have I missed a flag? FISTP should round to the nearest.
There was a problem hiding this comment.
it rounds to currently set rounding mode actually
Issue with this math will be somewhere else as that's def ceil called there in the binaries
|
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## develop #1163 +/- ##
===========================================
+ Coverage 2.53% 2.64% +0.11%
===========================================
Files 949 949
Lines 110747 110640 -107
Branches 18995 18994 -1
===========================================
+ Hits 2802 2930 +128
+ Misses 107542 107307 -235
Partials 403 403 ☔ View full report in Codecov by Sentry. |
Fixes #884
More faithful to Ghidra code would be addition of GameMath::Round() function, but since float errors are << 0.5 there is no difference compared to Floor.
Fixes #1081 and similar problem with America chemsuits. Suprisingly #911 remains broken