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

Fix character volume calculation #74348

Merged
merged 8 commits into from
Jun 15, 2024
13 changes: 9 additions & 4 deletions tests/char_volume_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,23 @@ TEST_CASE( "character_baseline_volumes", "[volume]" )
Character &you = get_player_character();
REQUIRE( you.get_mutations().empty() );
REQUIRE( you.height() == 175 );
CHECK( ( you.get_base_volume() > 55_liter && you.get_base_volume() < 80_liter ) );

REQUIRE( your_height_with_trait( trait_SMALL2 ) == 70 );
CHECK( your_volume_with_trait( trait_SMALL2 ) == 23326_ml );
CHECK( ( your_volume_with_trait( trait_SMALL2 ) > 20_liter &&
your_volume_with_trait( trait_SMALL2 ) < 30_liter ) );
RenechCDDA marked this conversation as resolved.
Show resolved Hide resolved

REQUIRE( your_height_with_trait( trait_SMALL ) == 122 );
CHECK( your_volume_with_trait( trait_SMALL ) == 42476_ml );
CHECK( ( your_volume_with_trait( trait_SMALL ) > 40_liter &&
your_volume_with_trait( trait_SMALL ) < 50_liter ) );

REQUIRE( your_height_with_trait( trait_LARGE ) == 227 );
CHECK( your_volume_with_trait( trait_LARGE ) == 116034_ml );
CHECK( ( your_volume_with_trait( trait_LARGE ) > 100_liter &&
your_volume_with_trait( trait_LARGE ) < 120_liter ) );

REQUIRE( your_height_with_trait( trait_HUGE ) == 280 );
CHECK( your_volume_with_trait( trait_HUGE ) == 156228_ml );
CHECK( ( your_volume_with_trait( trait_HUGE ) > 150_liter &&
your_volume_with_trait( trait_HUGE ) < 200_liter ) );
}

TEST_CASE( "character_at_volume_can_or_cannot_enter_vehicle", "[volume]" )
Expand Down
Loading