summaryrefslogtreecommitdiff
path: root/revert-19_Fix-Repair-Nanobots-3308.patch
blob: 040af83f722d3432bc5a5332b1429ef95c8eac54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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 6c7586bbfc1..1884f75e6f8 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<bodypart_id> 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.
-- 
2.42.0