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

Reduce liquid volume per turn by a factor of 6 #34234

Merged
merged 4 commits into from
Sep 26, 2019

Conversation

ZhilkinSerg
Copy link
Contributor

Summary

SUMMARY: Bugfixes "Reduce liquid volume per turn by a factor of 6"

Purpose of change

Amount of liquid transferred per turn was not changed after we moved from 6 to 1 second turns.

Describe the solution

Reduced amount of liquid transferred per turn by a factor of 6.

@ZhilkinSerg ZhilkinSerg added [C++] Changes (can be) made in C++. Previously named `Code` <Bugfix> This is a fix for a bug (or closes open issue) Mechanics: Character / Player Character / Player mechanics Time / Turns / Duration / Date Issues concerning any activities being too fast or too slow. Also issues about time and date ingame labels Sep 25, 2019
@@ -1330,7 +1330,7 @@ void activity_handlers::fill_liquid_do_turn( player_activity *act, player *p )
break;
}

static const auto volume_per_turn = units::from_liter( 4 );
static const auto volume_per_turn = units::from_liter( 4 / 6 );
Copy link
Member

@KorGgenT KorGgenT Sep 26, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while you're at it, wanna remove that auto in favor of units::volume? also that's integer division.

@kevingranade kevingranade merged commit 8466e67 into CleverRaven:master Sep 26, 2019
@ZhilkinSerg ZhilkinSerg deleted the fix-liquid-per-turn branch September 26, 2019 06:53
static const auto volume_per_turn = units::from_liter( 4 );
const int charges_per_turn = std::max( 1, liquid.charges_per_volume( volume_per_turn ) );
liquid.charges = std::min( charges_per_turn, liquid.charges );
static const units::volume volume_per_second = units::from_liter( 4 / 6 );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You changed this to 1 liter per second. 4 / 6 is 1 in C++ (both operands are integers, so integer division is performed). If you wan't floating points, you have to explicitly make one operand a floating point value: ( 4. / 6 )

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's 0 actually.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhh my brain, I should have noticed that but for some reason I thought it was ok because of the units interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Mechanics: Character / Player Character / Player mechanics Time / Turns / Duration / Date Issues concerning any activities being too fast or too slow. Also issues about time and date ingame
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants