Skip to content

Commit

Permalink
Prevents allied NPCs from fleeing from the player and turning hostile (
Browse files Browse the repository at this point in the history
…#78747)

* Do not set flee status if player is allied.

* Fix formatting
  • Loading branch information
Balthasar-eu authored Jan 7, 2025
1 parent e161b7c commit e26ce57
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/npcmove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit e26ce57

Please sign in to comment.