From b9b390148344526580577bf6e026f0d98e134b2d Mon Sep 17 00:00:00 2001 From: davidpwbrown <39344466+davidpwbrown@users.noreply.github.com> Date: Wed, 12 Feb 2020 20:58:28 +0000 Subject: [PATCH] Abandon camp fix (#37976) * use different pos as random NPC can be invalidated * remove random guy --- src/faction_camp.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/faction_camp.cpp b/src/faction_camp.cpp index fd3642b0dd0c8..e0d9a5dce0064 100644 --- a/src/faction_camp.cpp +++ b/src/faction_camp.cpp @@ -1557,13 +1557,11 @@ 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 ); } @@ -1571,7 +1569,7 @@ void basecamp::abandon_camp() 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 ); }