From c27b944790f2f0ffc1221e2782c5e11cd8e33064 Mon Sep 17 00:00:00 2001 From: Procyonae <45432782+Procyonae@users.noreply.github.com> Date: Wed, 11 Dec 2024 16:46:19 +0000 Subject: [PATCH] Fix a test expecting spawned NPCs to float --- tests/char_sight_test.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/char_sight_test.cpp b/tests/char_sight_test.cpp index 75ea99c443989..63c74dd73026d 100644 --- a/tests/char_sight_test.cpp +++ b/tests/char_sight_test.cpp @@ -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; @@ -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