summaryrefslogtreecommitdiff
path: root/revert-27_fix-NPCs-keep-their-splints-on-3589.patch
blob: 3bf0731a44b13daad459d920e951f9267c25c43c (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
From a3aaf76f252bc45f1e3b4da3fbf43e9208aefcb6 Mon Sep 17 00:00:00 2001
From: KheirFerrum <102964889+KheirFerrum@users.noreply.github.com>
Date: Wed, 8 Nov 2023 00:19:01 +0000
Subject: [PATCH 066/318] fix: NPCs keep their splints on (#3589)

* Use is_limb_broken like a normal function.

* Update npcmove.cpp
---
 src/npcmove.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/npcmove.cpp b/src/npcmove.cpp
index 3a0cd430288..2db92b4c253 100644
--- a/src/npcmove.cpp
+++ b/src/npcmove.cpp
@@ -4728,8 +4728,8 @@ bool npc::adjust_worn()
     }
     const auto covers_broken = [this]( const item & it, side s ) {
         const body_part_set covered = it.get_covered_body_parts( s );
-        for( const std::pair<const bodypart_str_id, bodypart> &elem : get_body() ) {
-            if( elem.second.get_hp_cur() <= 0 && covered.test( elem.first ) ) {
+        for( const bodypart_str_id &bp_id : covered ) {
+            if( is_limb_broken( bp_id ) && covered.test( bp_id ) ) {
                 return true;
             }
         }
-- 
2.42.0