diff --git a/src/npcmove.cpp b/src/npcmove.cpp index 3b8fbf2f4e9a2..b781234b6f513 100644 --- a/src/npcmove.cpp +++ b/src/npcmove.cpp @@ -1144,6 +1144,7 @@ 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( mem_combat.panic > 5 && is_player_ally() && sees( player_character.pos_bub() ) ) { // consider warning player about panic int panic_alert = rl_dist( pos(), player_character.pos() ) - player_character.get_per(); @@ -1368,7 +1369,11 @@ void npc::move() action = method_of_fleeing(); } else if( ( target == &player_character && attitude == NPCATT_FLEE_TEMP ) || has_effect( effect_npc_run_away ) ) { - action = method_of_fleeing(); + if( hp_percentage() > 30 && target && rl_dist( pos(), target->pos() ) <= 1 ) { + action = method_of_attack(); + } else { + action = method_of_fleeing(); + } } else if( has_effect( effect_asthma ) && ( has_charges( itype_inhaler, 1 ) || has_charges( itype_oxygen_tank, 1 ) || has_charges( itype_smoxygen_tank, 1 ) ) ) {