Skip to content

Commit

Permalink
Fix house id matching in hardcoded missions
Browse files Browse the repository at this point in the history
  • Loading branch information
ralreegorganon committed Jan 28, 2020
1 parent 3da5eb4 commit eb48b26
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 eb48b26

Please sign in to comment.