diff options
author | jc_gargma <jc_gargma@iserlohn-fortress.net> | 2025-01-18 21:46:00 -0800 |
---|---|---|
committer | jc_gargma <jc_gargma@iserlohn-fortress.net> | 2025-01-18 21:46:00 -0800 |
commit | 7e224c97ae2728472180322f625dafa545f21f7f (patch) | |
tree | 61a296000b3a05d36cde4de0d8bd5e5179ee21ab /revert-26_fix-npc-splints-and-clean-up-iterator-errors-3592.patch | |
parent | Add plastic scrap is stackable patch. (diff) | |
download | cataclysm-bn-7e224c97ae2728472180322f625dafa545f21f7f.tar.xz |
Diffstat (limited to 'revert-26_fix-npc-splints-and-clean-up-iterator-errors-3592.patch')
-rw-r--r-- | revert-26_fix-npc-splints-and-clean-up-iterator-errors-3592.patch | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/revert-26_fix-npc-splints-and-clean-up-iterator-errors-3592.patch b/revert-26_fix-npc-splints-and-clean-up-iterator-errors-3592.patch deleted file mode 100644 index f302dc8..0000000 --- a/revert-26_fix-npc-splints-and-clean-up-iterator-errors-3592.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 17831b78d407a5abfc9389b35202b807ce5df8c4 Mon Sep 17 00:00:00 2001 -From: joveeater <joveasarus@gmail.com> -Date: Wed, 8 Nov 2023 00:18:59 +0000 -Subject: [PATCH 065/318] fix: npc splints and clean up iterator errors (#3592) - -* Fix splints and clean up iterator errors - -* style(autofix.ci): automated formatting - ---------- - -Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> ---- - src/item.cpp | 1 + - src/npcmove.cpp | 13 ++++++++++++- - 3 files changed, 13 insertions(+), 8 deletions(-) - -diff --git a/src/item.cpp b/src/item.cpp -index 3674560e548..d772312c36a 100644 ---- a/src/item.cpp -+++ b/src/item.cpp -@@ -483,6 +483,7 @@ item &item::operator=( const item &source ) - invlet = source.invlet; - active = source.active; - activated_by = source.activated_by; -+ is_favorite = source.is_favorite; - - contents.clear_items(); - -diff --git a/src/npcmove.cpp b/src/npcmove.cpp -index c3470703e8a..3a0cd430288 100644 ---- a/src/npcmove.cpp -+++ b/src/npcmove.cpp -@@ -4736,6 +4736,7 @@ bool npc::adjust_worn() - return false; - }; - -+ item *splint = nullptr; - for( auto &elem : worn ) { - if( !elem->has_flag( flag_SPLINT ) ) { - continue; -@@ -4744,11 +4745,21 @@ bool npc::adjust_worn() - if( !covers_broken( *elem, elem->get_side() ) ) { - const bool needs_change = covers_broken( *elem, opposite_side( elem->get_side() ) ); - // Try to change side (if it makes sense), or take off. -- if( ( needs_change && change_side( *elem ) ) || takeoff( *elem ) ) { -+ if( needs_change && change_side( *elem ) ) { - return true; - } -+ -+ if( can_takeoff( *elem ).success() ) { -+ splint = elem; -+ break; -+ } -+ - } - } -+ if( splint ) { -+ takeoff( *splint ); -+ return true; -+ } - - return false; - } --- -2.42.0 - |