-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Reduce liquid volume per turn by a factor of 6 #34234
Conversation
src/activity_handlers.cpp
Outdated
@@ -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 ); |
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.
while you're at it, wanna remove that auto in favor of units::volume? also that's integer division.
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 ); |
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.
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 )
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's 0 actually.
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.
Ahhh my brain, I should have noticed that but for some reason I thought it was ok because of the units interface.
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.