Skip to content

Commit

Permalink
Another test that expects floating to be fine
Browse files Browse the repository at this point in the history
  • Loading branch information
Procyonae committed Dec 11, 2024
1 parent c27b944 commit 4e8a51a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/char_sight_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,17 @@ TEST_CASE( "light_and_fine_detail_vision_mod", "[character][sight][light][vision
SECTION( "midnight with a new moon" ) {
// yes, surprisingly, we need to test for this
calendar::turn = calendar::turn_zero;
tripoint const z_shift = GENERATE( tripoint::above, tripoint::zero );
dummy.setpos( dummy.pos() + z_shift ); // This implicitly rebuilds the light map.
tripoint_bub_ms const z_shift = GENERATE( tripoint_bub_ms::above, tripoint_bub_ms::zero );
// This implicitly rebuilds the light map but in a hacky way so we need to prevent the player falling
dummy.setpos( dummy.pos_bub() + z_shift, false );
CAPTURE( z_shift );
REQUIRE_FALSE( g->is_in_sunlight( dummy.pos() ) );
REQUIRE( here.ambient_light_at( dummy.pos_bub() ) == Approx( LIGHT_AMBIENT_MINIMAL ) );

// 7.3 is LIGHT_AMBIENT_MINIMAL, a dark cloudy night, unlit indoors
CHECK( dummy.fine_detail_vision_mod() == Approx( 7.3f ) );

dummy.setpos( dummy.pos() - z_shift );
dummy.setpos( dummy.pos() - z_shift, false );
}

SECTION( "blindfolded" ) {
Expand Down

0 comments on commit 4e8a51a

Please sign in to comment.