Skip to content

Commit

Permalink
Add test for fake part transparency handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevingranade committed May 3, 2022
1 parent 3a5b240 commit 7e330a3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/vehicle_fake_part_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "map.h"
#include "map_helpers.h"
#include "optional.h"
#include "player_helpers.h"
#include "point.h"
#include "type_id.h"
#include "vehicle.h"
Expand Down Expand Up @@ -318,3 +319,20 @@ TEST_CASE( "ensure_vehicle_with_no_obstacles_has_no_fake_parts", "[vehicle] [veh
}
}
}

TEST_CASE( "fake_parts_are_opaque", "[vehicle],[vehicle_fake]" )
{
really_clear_map();
Character &you = get_player_character();
clear_avatar();
const tripoint test_origin = you.pos() + point( 6, 2 );
map &here = get_map();
set_time_to_day();

REQUIRE( you.sees( you.pos() + point( 10, 10 ) ) );
vehicle *veh = here.add_vehicle( vehicle_prototype_test_van, test_origin, 315_degrees, 100, 0 );
REQUIRE( veh != nullptr );
here.build_map_cache( 0 );
here.build_lightmap( 0, you.pos() );
CHECK( !you.sees( you.pos() + point( 10, 10 ) ) );
}

0 comments on commit 7e330a3

Please sign in to comment.