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
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/game/client/drawable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3185,7 +3185,7 @@ void Drawable::Update_Drawable()
(*modules)->Set_Terrain_Decal_Opacity(m_terrainDecalOpacity);
}

if (m_terrainDecalFadeTarget2 < 0.0f || m_terrainDecalOpacity <= 0.0f) {
if (m_terrainDecalFadeTarget2 < 0.0f && m_terrainDecalOpacity <= 0.0f) {
m_terrainDecalFadeTarget2 = 0.0f;
m_terrainDecalOpacity = 0.0f;
Set_Terrain_Decal(TERRAIN_DECAL_8);
Expand Down
2 changes: 1 addition & 1 deletion src/game/common/rts/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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


if (amount != 0) {
Get_Money()->Deposit(amount, true);
Expand Down