summaryrefslogtreecommitdiff
path: root/src-16_npcs-not-wielding-from-worn-holsters.patch
diff options
context:
space:
mode:
authorjc_gargma <jc_gargma@iserlohn-fortress.net>2024-07-27 01:36:19 -0700
committerjc_gargma <jc_gargma@iserlohn-fortress.net>2024-07-27 01:36:19 -0700
commitc0fad7538e0d4fc60f75152d210c8734a09f92c6 (patch)
tree707d0fb871f0ee9a1d5be58d79e3a90b1a96a895 /src-16_npcs-not-wielding-from-worn-holsters.patch
parentFix several more sealed foods spawning partially full. Also fix building with... (diff)
downloadcataclysm-bn-c0fad7538e0d4fc60f75152d210c8734a09f92c6.tar.xz
Add patch fixing NPCs failing to wield weapons from worn holsters.
Diffstat (limited to 'src-16_npcs-not-wielding-from-worn-holsters.patch')
-rw-r--r--src-16_npcs-not-wielding-from-worn-holsters.patch11
1 files changed, 11 insertions, 0 deletions
diff --git a/src-16_npcs-not-wielding-from-worn-holsters.patch b/src-16_npcs-not-wielding-from-worn-holsters.patch
new file mode 100644
index 0000000..5173f86
--- /dev/null
+++ b/src-16_npcs-not-wielding-from-worn-holsters.patch
@@ -0,0 +1,11 @@
+--- a/src/npcmove.cpp
++++ b/src/npcmove.cpp
+@@ -3513,7 +3513,7 @@
+ // if they don't have a weapon with appropriate range/ammo.
+ visit_items( [&compare_weapon, this ]( item * node ) {
+ // For worn items, only compare if they have a weapon category defined.
+- if( is_worn( *node ) && node->type->weapon_category.empty() ) {
++ if( is_worn( *node ) && !( node->get_use( "holster" ) ) && node->type->weapon_category.empty() ) {
+ return VisitResponse::SKIP;
+ }
+ // Otherwise, compare any melee usable item, guns or holstered items