Skip to content
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

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open

Boolean Fixes #1163

wants to merge 5 commits into from

Conversation

6emmes
Copy link
Contributor

@6emmes 6emmes commented Oct 10, 2024

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

@6emmes 6emmes changed the title Change rounding method in GLA bounty calculation Boolean Fixes Oct 18, 2024
@@ -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);
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

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-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 2.64%. Comparing base (9a10575) to head (7e8941d).
Report is 16 commits behind head on develop.

Files with missing lines Patch % Lines
src/game/client/drawable.cpp 0.00% 1 Missing ⚠️
src/game/common/ini/ini.cpp 0.00% 1 Missing ⚠️

❗ 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.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants