diff --git a/tests/map_helpers.cpp b/tests/map_helpers.cpp index 216e108450871..0de772d51460c 100644 --- a/tests/map_helpers.cpp +++ b/tests/map_helpers.cpp @@ -139,6 +139,8 @@ void clear_basecamps() void clear_map( int zmin, int zmax ) { map &here = get_map(); + // Reset z level to 0 + here.load( tripoint_abs_sm( here.get_abs_sub().xy(), 0 ), false ); // Clearing all z-levels is rather slow, so just clear the ones I know the // tests use for now. for( int z = zmin; z <= zmax; ++z ) { diff --git a/tests/vehicle_split_test.cpp b/tests/vehicle_split_test.cpp index ae784ee10a3b4..160d4d3f0c649 100644 --- a/tests/vehicle_split_test.cpp +++ b/tests/vehicle_split_test.cpp @@ -85,14 +85,10 @@ TEST_CASE( "vehicle_split_section", "[vehicle]" ) TEST_CASE( "conjoined_vehicles", "[vehicle]" ) { map &here = get_map(); - here.add_vehicle( vehicle_prototype_car, tripoint_bub_ms( 40, 40, here.get_abs_sub().z() ), - 0_degrees ); - here.add_vehicle( vehicle_prototype_car, tripoint_bub_ms( 42, 42, here.get_abs_sub().z() ), - 0_degrees ); - here.add_vehicle( vehicle_prototype_car, tripoint_bub_ms( 44, 44, here.get_abs_sub().z() ), - 45_degrees ); - here.add_vehicle( vehicle_prototype_car, tripoint_bub_ms( 48, 44, here.get_abs_sub().z() ), - 45_degrees ); + here.add_vehicle( vehicle_prototype_car, tripoint_bub_ms( 40, 40, 0 ), 0_degrees ); + here.add_vehicle( vehicle_prototype_car, tripoint_bub_ms( 42, 42, 0 ), 0_degrees ); + here.add_vehicle( vehicle_prototype_car, tripoint_bub_ms( 44, 44, 0 ), 45_degrees ); + here.add_vehicle( vehicle_prototype_car, tripoint_bub_ms( 48, 44, 0 ), 45_degrees ); } TEST_CASE( "crater_crash", "[vehicle]" ) @@ -100,7 +96,7 @@ TEST_CASE( "crater_crash", "[vehicle]" ) tinymap here; tripoint_abs_omt map_location( 30, 30, 0 ); here.load( map_location, true ); - here.add_vehicle( vehicle_prototype_car, { 14, 11, here.get_abs_sub().z() }, 45_degrees ); + here.add_vehicle( vehicle_prototype_car, { 14, 11, 0 }, 45_degrees ); const tripoint_omt_ms end{ 20, 20, 0 }; for( tripoint_omt_ms cursor = { 14, 4, 0 }; cursor.y() < end.y(); cursor.y()++ ) { for( cursor.x() = 4; cursor.x() < end.x(); cursor.x()++ ) { @@ -118,7 +114,8 @@ TEST_CASE( "split_vehicle_during_mapgen", "[vehicle]" ) tinymap tm; // Wherever the main map is, create this tinymap outside its bounds. - tm.load( project_to( here.get_abs_sub() ) + tripoint_rel_omt( 10, 10, 0 ), false ); + tm.load( tripoint_abs_omt( project_to( here.get_abs_sub().xy() ), 0 ) + + tripoint_rel_omt( 10, 10, 0 ), false ); wipe_map_terrain( tm.cast_to_map() ); REQUIRE( tm.get_vehicles().empty() ); tripoint_omt_ms vehicle_origin{ 14, 14, 0 }; diff --git a/tests/vehicle_turrets_test.cpp b/tests/vehicle_turrets_test.cpp index 3339b25d944f3..c97f868336eaf 100644 --- a/tests/vehicle_turrets_test.cpp +++ b/tests/vehicle_turrets_test.cpp @@ -47,19 +47,13 @@ TEST_CASE( "vehicle_turret", "[vehicle][gun][magazine]" ) clear_avatar(); map &here = get_map(); Character &player_character = get_player_character(); - const tripoint_bub_ms veh_pos( 65, 65, here.get_abs_sub().z() ); - // TODO: Get rid of this set of tests when the cause of this test randomly failing has been eliminated. - REQUIRE( veh_pos.z() == 0 ); - REQUIRE( vehicle_prototype_test_turret_rig.is_valid() ); - REQUIRE( here.inbounds( veh_pos ) ); - // TODO: End + const tripoint_bub_ms veh_pos( 65, 65, 0 ); for( const vpart_info *turret_vpi : all_turret_types() ) { SECTION( turret_vpi->name() ) { - vehicle *veh = here.add_vehicle( vehicle_prototype_test_turret_rig, veh_pos, 270_degrees, 0, 0, - false ); + vehicle *veh = here.add_vehicle( vehicle_prototype_test_turret_rig, veh_pos, 270_degrees, 0, 2, + false, true ); REQUIRE( veh ); - veh->unlock(); const int turr_idx = veh->install_part( point_rel_ms::zero, turret_vpi->id ); REQUIRE( turr_idx >= 0 );