diff --git a/src/faction.cpp b/src/faction.cpp index 788fadeeb7710..ea259a53e7167 100644 --- a/src/faction.cpp +++ b/src/faction.cpp @@ -547,13 +547,9 @@ int npc::faction_display( const catacurses::window &fac_w, const int width ) con nc_color see_color; bool u_has_radio = g->u.has_item_with_flag( "TWO_WAY_RADIO", true ); bool guy_has_radio = has_item_with_flag( "TWO_WAY_RADIO", true ); - // TODO: NPCS on mission contactable same as travelling - if( has_companion_mission() && mission != NPC_MISSION_TRAVELLING ) { - can_see = _( "Not interactable while on a mission" ); - see_color = c_light_red; - // is the NPC even in the same area as the player? - } else if( rl_dist( player_abspos, global_omt_location() ) > 3 || - ( rl_dist( g->u.pos(), pos() ) > SEEX * 2 || !g->u.sees( pos() ) ) ) { + // is the NPC even in the same area as the player? + if( rl_dist( player_abspos, global_omt_location() ) > 3 || + ( rl_dist( g->u.pos(), pos() ) > SEEX * 2 || !g->u.sees( pos() ) ) ) { if( u_has_radio && guy_has_radio ) { // TODO: better range calculation than just elevation. int max_range = 200; @@ -598,6 +594,11 @@ int npc::faction_display( const catacurses::window &fac_w, const int width ) con can_see = _( "Within interaction range" ); see_color = c_light_green; } + // TODO: NPCS on mission contactable same as traveling + if( has_companion_mission() ) { + can_see = _( "Press enter to recall from their mission." ); + see_color = c_light_red; + } mvwprintz( fac_w, point( width, ++y ), see_color, "%s", can_see ); nc_color status_col = col; std::string current_status = _( "Status: " ); @@ -864,10 +865,15 @@ void faction_manager::display() const selection--; } } else if( action == "CONFIRM" ) { - if( tab == tab_mode::TAB_FOLLOWERS && guy && ( interactable || radio_interactable ) ) { - guy->talk_to_u( false, radio_interactable ); - } else if( tab == tab_mode::TAB_MYFACTION && camp ) { - camp->query_new_name(); + if( guy->has_companion_mission() ) { + guy->reset_companion_mission(); + popup( _( "%s returns from their mission" ), guy->disp_name() ); + } else { + if( tab == tab_mode::TAB_FOLLOWERS && guy && ( interactable || radio_interactable ) ) { + guy->talk_to_u( false, radio_interactable ); + } else if( tab == tab_mode::TAB_MYFACTION && camp ) { + camp->query_new_name(); + } } } else if( action == "QUIT" ) { break; diff --git a/src/game.cpp b/src/game.cpp index 224f4d869f96f..b6c7963465d2c 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -866,7 +866,7 @@ void game::load_npcs() if( temp->is_active() ) { continue; } - if( ( temp->has_companion_mission() ) && ( temp->mission != NPC_MISSION_TRAVELLING ) ) { + if( temp->has_companion_mission() ) { continue; } diff --git a/src/npctalk_funcs.cpp b/src/npctalk_funcs.cpp index cb1ce46010bd6..f17930dcc6977 100644 --- a/src/npctalk_funcs.cpp +++ b/src/npctalk_funcs.cpp @@ -334,7 +334,6 @@ void talk_function::goto_location( npc &p ) add_msg( m_info, _( "That is not a valid destination for %s." ), p.disp_name() ); return; } - p.set_companion_mission( p.global_omt_location(), "TRAVELLER", "travelling", destination ); p.set_mission( NPC_MISSION_TRAVELLING ); p.chatbin.first_topic = "TALK_FRIEND_GUARD"; p.guard_pos = npc::no_goal_point; @@ -352,12 +351,6 @@ void talk_function::assign_guard( npc &p ) if( p.has_player_activity() ) { p.revert_after_activity(); } - - if( p.is_travelling() ) { - if( p.has_companion_mission() ) { - p.reset_companion_mission(); - } - } p.set_attitude( NPCATT_NULL ); p.set_mission( NPC_MISSION_GUARD_ALLY ); p.chatbin.first_topic = "TALK_FRIEND_GUARD"; @@ -385,12 +378,6 @@ void talk_function::assign_camp( npc &p ) if( p.has_player_activity() ) { p.revert_after_activity(); } - - if( p.is_travelling() ) { - if( p.has_companion_mission() ) { - p.reset_companion_mission(); - } - } p.chatbin.first_topic = "TALK_FRIEND_GUARD"; p.set_omt_destination(); temp_camp->job_assignment_ui(); @@ -408,6 +395,9 @@ void talk_function::stop_guard( npc &p ) add_msg( _( "%s begins to follow you." ), p.name ); p.set_mission( NPC_MISSION_NULL ); p.set_job( static_cast( 0 ) ); + if( p.has_companion_mission() ) { + p.reset_companion_mission(); + } p.chatbin.first_topic = "TALK_FRIEND"; p.goal = npc::no_goal_point; p.guard_pos = npc::no_goal_point;