-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Boolean Fixes #1163
base: develop
Are you sure you want to change the base?
Boolean Fixes #1163
Conversation
src/game/common/rts/player.cpp
Outdated
@@ -2998,7 +2998,7 @@ void Player::Do_Bounty_For_Kill(const Object *killer, const Object *killed) | |||
{ | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fast_To_Int_Ceil was correct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have I missed a flag? FISTP should round to the nearest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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