From 7e688c1803425f22daeb0ecf503d1d8e4094c6fe Mon Sep 17 00:00:00 2001 From: BevapDin Date: Sat, 24 Aug 2019 12:36:24 +0200 Subject: [PATCH 1/2] Make repair_actions non-static. Put them into `Item_factory` and clear and reset them on each game resetting. --- src/item_factory.cpp | 3 +-- src/item_factory.h | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/item_factory.cpp b/src/item_factory.cpp index ce59b2e894f2b..fa581c547e8dc 100644 --- a/src/item_factory.cpp +++ b/src/item_factory.cpp @@ -53,8 +53,6 @@ struct tripoint; using t_string_set = std::set; static t_string_set item_blacklist; -static std::set repair_actions; - static DynamicDataLoader::deferred_json deferred; std::unique_ptr item_controller = std::make_unique(); @@ -2335,6 +2333,7 @@ void Item_factory::clear() repair_tools.clear(); gun_tools.clear(); + repair_actions.clear(); frozen = false; } diff --git a/src/item_factory.h b/src/item_factory.h index c37ce0f0c14ff..3c410c8185249 100644 --- a/src/item_factory.h +++ b/src/item_factory.h @@ -375,6 +375,8 @@ class Item_factory // tools that can be used to repair wood/paper/bone/chitin items std::set misc_tools; + + std::set repair_actions; }; #endif From 12129742a33a9babff92d31034ede24f0ea8772a Mon Sep 17 00:00:00 2001 From: BevapDin Date: Sat, 24 Aug 2019 12:36:56 +0200 Subject: [PATCH 2/2] Also clear Item_factory::misc_tools --- src/item_factory.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/item_factory.cpp b/src/item_factory.cpp index fa581c547e8dc..f91f182a62efa 100644 --- a/src/item_factory.cpp +++ b/src/item_factory.cpp @@ -2333,6 +2333,7 @@ void Item_factory::clear() repair_tools.clear(); gun_tools.clear(); + misc_tools.clear(); repair_actions.clear(); frozen = false;