Skip to content

Commit

Permalink
Merge pull request #37473 from ralreegorganon/fix-house-matching
Browse files Browse the repository at this point in the history
Fix house id matching in hardcoded missions
  • Loading branch information
ZhilkinSerg committed Jan 28, 2020
2 parents 9dea9f6 + eb48b26 commit fb0e570
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/mission_companion.cpp
Expand Up @@ -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 );
}
Expand Down
2 changes: 1 addition & 1 deletion src/mission_util.cpp
Expand Up @@ -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<tripoint> 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 );
}
}
Expand Down

0 comments on commit fb0e570

Please sign in to comment.