diff --git a/tests/monster_attack_test.cpp b/tests/monster_attack_test.cpp index fac14defbd1ac..5b8f1f2372aff 100644 --- a/tests/monster_attack_test.cpp +++ b/tests/monster_attack_test.cpp @@ -5,6 +5,7 @@ #include "calendar.h" #include "catch/catch.hpp" #include "character.h" +#include "game.h" #include "map.h" #include "map_helpers.h" #include "monster.h" @@ -12,6 +13,8 @@ #include "player_helpers.h" #include "point.h" #include "type_id.h" +#include "weather.h" +#include "weather_type.h" static constexpr tripoint attacker_location{ 65, 65, 0 }; @@ -28,6 +31,7 @@ static void test_monster_attack( const tripoint &target_offset, bool expect_atta Character &you = get_player_character(); clear_avatar(); you.setpos( target_location ); + you.recalc_sight_limits(); monster &test_monster = spawn_test_monster( monster_type, attacker_location ); // Trigger basic attack. CAPTURE( attacker_location ); @@ -39,6 +43,7 @@ static void test_monster_attack( const tripoint &target_offset, bool expect_atta clear_creatures(); clear_avatar(); you.setpos( attacker_location ); + you.recalc_sight_limits(); monster &target_monster = spawn_test_monster( monster_type, target_location ); CHECK( you.sees( target_monster ) == expect_vision ); CHECK( you.melee_attack( target_monster, false ) == expect_attack ); @@ -74,6 +79,7 @@ TEST_CASE( "monster_attack" ) clear_map(); restore_on_out_of_scope restore_calendar_turn( calendar::turn ); calendar::turn = daylight_time( calendar::turn ) + 2_hours; + get_weather().weather_override = WEATHER_CLEAR; // Do I need to put this back? SECTION( "attacking on open ground" ) { // Adjacent can attack of course. for( const tripoint &offset : eight_horizontal_neighbors ) {