From e26ce57a085d322bcbf1cd964df5f1340b2cb183 Mon Sep 17 00:00:00 2001 From: Balthasar <36669346+Balthasar-eu@users.noreply.github.com> Date: Tue, 7 Jan 2025 06:15:15 +0100 Subject: [PATCH] Prevents allied NPCs from fleeing from the player and turning hostile (#78747) * Do not set flee status if player is allied. * Fix formatting --- src/npcmove.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/npcmove.cpp b/src/npcmove.cpp index 75609541c29f5..b7916a17011d9 100644 --- a/src/npcmove.cpp +++ b/src/npcmove.cpp @@ -1146,7 +1146,9 @@ void npc::act_on_danger_assessment() add_msg_debug( debugmode::DF_NPC_COMBATAI, "%s upgrades reposition to flat out retreat.", name ); mem_combat.repositioning = false; // we're not just moving, we're running. warn_about( "run_away", run_away_for ); - set_attitude( NPCATT_FLEE_TEMP ); + if( !is_player_ally() ) { + set_attitude( NPCATT_FLEE_TEMP ); + } if( mem_combat.panic > 5 && is_player_ally() && sees( player_character.pos_bub() ) ) { // consider warning player about panic int panic_alert = rl_dist( pos_bub(), player_character.pos_bub() ) - player_character.get_per();