Skip to content

Commit

Permalink
Abandon camp fix (#37976)
Browse files Browse the repository at this point in the history
* use different pos as random NPC can be invalidated

* remove random guy
  • Loading branch information
davidpwbrown authored Feb 12, 2020
1 parent f7cd6e8 commit b9b3901
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/faction_camp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1557,21 +1557,19 @@ void basecamp::start_upgrade( const std::string &bldg, const point &dir,
void basecamp::abandon_camp()
{
validate_assignees();
npc_ptr random_guy;
for( npc_ptr &guy : overmap_buffer.get_companion_mission_npcs( 10 ) ) {
npc_companion_mission c_mission = guy->get_companion_mission();
if( c_mission.role_id != base_camps::id ) {
continue;
}
random_guy = guy;
const std::string return_msg = _( "responds to the emergency recall…" );
finish_return( *guy, false, return_msg, "menial", 0, true );
}
for( npc_ptr &guy : get_npcs_assigned() ) {
talk_function::stop_guard( *guy );
}
overmap_buffer.remove_camp( *this );
g->m.remove_submap_camp( random_guy->pos() );
g->m.remove_submap_camp( bb_pos );
add_msg( m_info, _( "You abandon %s." ), name );
}

Expand Down

0 comments on commit b9b3901

Please sign in to comment.