Skip to content

Commit

Permalink
Fix a test expecting spawned NPCs to float
Browse files Browse the repository at this point in the history
  • Loading branch information
Procyonae committed Dec 11, 2024
1 parent 6d78f96 commit c27b944
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/char_sight_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ TEST_CASE( "npc_light_and_fine_detail_vision_mod", "[character][npc][sight][ligh
clear_map();
tripoint const u_shift = GENERATE( tripoint::zero, tripoint::above );
CAPTURE( u_shift );
u.setpos( u.pos() + u_shift );
// Allow player to float for purpose of purely testing this and not factoring in terrain potentially blocking vision etc
u.setpos( u.pos() + u_shift, false );
scoped_weather_override weather_clear( WEATHER_CLEAR );

time_point time_dst;
Expand All @@ -136,11 +137,12 @@ TEST_CASE( "npc_light_and_fine_detail_vision_mod", "[character][npc][sight][ligh
set_time( time_dst );
REQUIRE( u.fine_detail_vision_mod() == expected_vision );
SECTION( "NPC on same z-level" ) {
n.setpos( u.pos() + tripoint::east );
// Allow NPC to float for purpose of purely testing this and not factoring in terrain potentially blocking vision etc
n.setpos( u.pos() + tripoint::east, false );
CHECK( n.fine_detail_vision_mod() == u.fine_detail_vision_mod() );
}
SECTION( "NPC on a different z-level" ) {
n.setpos( u.pos() + tripoint::above );
n.setpos( u.pos() + tripoint::above, false );
// light map is not calculated outside the player character's z-level
// even if fov_3d_z_range > 0, and building light map on multiple levels
// could be expensive, so make NPCs able to see things in this case to
Expand Down

0 comments on commit c27b944

Please sign in to comment.