From 88924caafa4534a8c6a3d0f4bf84913a85ef3361 Mon Sep 17 00:00:00 2001 From: KheirFerrum <102964889+KheirFerrum@users.noreply.github.com> Date: Fri, 29 Sep 2023 15:02:13 +0100 Subject: [PATCH] Fix Repair Nanobots (#3308) * Add back code that marks limbs for healing. * style(autofix.ci): automated formatting --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- src/bionics.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/bionics.cpp b/src/bionics.cpp index 6c7586bbfc15..1884f75e6f8a 100644 --- a/src/bionics.cpp +++ b/src/bionics.cpp @@ -1673,6 +1673,12 @@ void Character::process_bionic( bionic &bio ) } if( calendar::once_every( 2_minutes ) ) { std::vector damaged_hp_parts; + for( const bodypart_id &bp : get_all_body_parts( true ) ) { + const int hp_cur = get_part_hp_cur( bp ); + if( !is_limb_broken( bp ) && hp_cur < get_part_hp_max( bp ) ) { + damaged_hp_parts.push_back( bp ); + } + } if( !damaged_hp_parts.empty() ) { // Essential parts are considered 10 HP lower than non-essential parts for the purpose of determining priority. // I'd use the essential_value, but it's tied up in the heal_actor class of iuse_actor.