From eb48b261e3dfc8c4d842478d3618027cbe84e54d Mon Sep 17 00:00:00 2001 From: Jason Jones Date: Tue, 28 Jan 2020 09:30:30 -0900 Subject: [PATCH] Fix house id matching in hardcoded missions --- src/mission_companion.cpp | 7 +++++-- src/mission_util.cpp | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mission_companion.cpp b/src/mission_companion.cpp index 1db7e6b1ed35a..f134b69f85856 100644 --- a/src/mission_companion.cpp +++ b/src/mission_companion.cpp @@ -1253,9 +1253,12 @@ bool talk_function::scavenging_raid_return( npc &p ) } } //The loot value needs to be added to the faction - what the player is payed + tripoint loot_location = g->u.global_omt_location(); + // Only check at the ground floor. + loot_location.z = 0; for( int i = 0; i < rng( 2, 3 ); i++ ) { - const tripoint site = overmap_buffer.find_closest( g->u.global_omt_location(), "house", - 0, false ); + const tripoint site = overmap_buffer.find_closest( loot_location, "house", 0, false, + ot_match_type::prefix ); overmap_buffer.reveal( site, 2 ); loot_building( site ); } diff --git a/src/mission_util.cpp b/src/mission_util.cpp index 2dfafb855e82c..3d84e289cc4fd 100644 --- a/src/mission_util.cpp +++ b/src/mission_util.cpp @@ -115,7 +115,7 @@ static tripoint random_house_in_city( const city_reference &cref ) const tripoint city_center_omt = sm_to_omt_copy( cref.abs_sm_pos ); std::vector valid; for( const tripoint &p : points_in_radius( city_center_omt, cref.city->size ) ) { - if( overmap_buffer.check_ot( "house", ot_match_type::type, p ) ) { + if( overmap_buffer.check_ot( "house", ot_match_type::prefix, p ) ) { valid.push_back( p ); } }