From a404ab3096e7fb981ee7fd92445f703c397eecac Mon Sep 17 00:00:00 2001 From: Kelly Kinkade Date: Thu, 16 Aug 2018 10:21:44 -0500 Subject: [PATCH 1/5] nestboxes: clean up & update description --- plugins/devel/nestboxes.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/plugins/devel/nestboxes.cpp b/plugins/devel/nestboxes.cpp index 634735f78..4276bef38 100644 --- a/plugins/devel/nestboxes.cpp +++ b/plugins/devel/nestboxes.cpp @@ -68,9 +68,11 @@ DFhackCExport command_result plugin_init (color_ostream &out, std::vector & parameters) { CoreSuspender suspend; - bool clean = false; - int dump_count = 0; - int good_egg = 0; if (parameters.size() == 1) { if (parameters[0] == "enable") From c840321edf48c30721ea2eec6afb2a9372d5834f Mon Sep 17 00:00:00 2001 From: Kelly Kinkade Date: Thu, 16 Aug 2018 10:23:15 -0500 Subject: [PATCH 2/5] move nestboxes out of devel --- plugins/CMakeLists.txt | 1 + plugins/devel/CMakeLists.txt | 1 - plugins/{devel => }/nestboxes.cpp | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename plugins/{devel => }/nestboxes.cpp (100%) diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 951a1d2d6..208da7125 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -138,6 +138,7 @@ if (BUILD_SUPPORTED) DFHACK_PLUGIN(misery misery.cpp) DFHACK_PLUGIN(mode mode.cpp) DFHACK_PLUGIN(mousequery mousequery.cpp) + DFHACK_PLUGIN(nestboxes nestboxes.cpp) DFHACK_PLUGIN(orders orders.cpp LINK_LIBRARIES jsoncpp_lib_static) DFHACK_PLUGIN(pathable pathable.cpp LINK_LIBRARIES lua) DFHACK_PLUGIN(petcapRemover petcapRemover.cpp) diff --git a/plugins/devel/CMakeLists.txt b/plugins/devel/CMakeLists.txt index 4fb4b5cf5..9478ba805 100644 --- a/plugins/devel/CMakeLists.txt +++ b/plugins/devel/CMakeLists.txt @@ -11,7 +11,6 @@ DFHACK_PLUGIN(eventExample eventExample.cpp) DFHACK_PLUGIN(frozen frozen.cpp) DFHACK_PLUGIN(kittens kittens.cpp) DFHACK_PLUGIN(memview memview.cpp memutils.cpp LINK_LIBRARIES lua) -DFHACK_PLUGIN(nestboxes nestboxes.cpp) DFHACK_PLUGIN(notes notes.cpp) DFHACK_PLUGIN(onceExample onceExample.cpp) DFHACK_PLUGIN(renderer-msg renderer-msg.cpp) diff --git a/plugins/devel/nestboxes.cpp b/plugins/nestboxes.cpp similarity index 100% rename from plugins/devel/nestboxes.cpp rename to plugins/nestboxes.cpp From 750b3cb8850a3ce186666e0b57c4922387402d8c Mon Sep 17 00:00:00 2001 From: Kelly Kinkade Date: Thu, 16 Aug 2018 10:30:53 -0500 Subject: [PATCH 3/5] the tabmonster strikes again --- plugins/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 208da7125..0a21fc270 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -137,8 +137,8 @@ if (BUILD_SUPPORTED) DFHACK_PLUGIN(manipulator manipulator.cpp) DFHACK_PLUGIN(misery misery.cpp) DFHACK_PLUGIN(mode mode.cpp) - DFHACK_PLUGIN(mousequery mousequery.cpp) - DFHACK_PLUGIN(nestboxes nestboxes.cpp) + DFHACK_PLUGIN(mousequery mousequery.cpp) + DFHACK_PLUGIN(nestboxes nestboxes.cpp) DFHACK_PLUGIN(orders orders.cpp LINK_LIBRARIES jsoncpp_lib_static) DFHACK_PLUGIN(pathable pathable.cpp LINK_LIBRARIES lua) DFHACK_PLUGIN(petcapRemover petcapRemover.cpp) From 784c3b1590d7db8c43cb2445afcbe31bc4333a77 Mon Sep 17 00:00:00 2001 From: Kelly Kinkade Date: Thu, 16 Aug 2018 10:32:50 -0500 Subject: [PATCH 4/5] a pox on invisible whitespace --- plugins/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 0a21fc270..d0e7df34b 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -137,7 +137,7 @@ if (BUILD_SUPPORTED) DFHACK_PLUGIN(manipulator manipulator.cpp) DFHACK_PLUGIN(misery misery.cpp) DFHACK_PLUGIN(mode mode.cpp) - DFHACK_PLUGIN(mousequery mousequery.cpp) + DFHACK_PLUGIN(mousequery mousequery.cpp) DFHACK_PLUGIN(nestboxes nestboxes.cpp) DFHACK_PLUGIN(orders orders.cpp LINK_LIBRARIES jsoncpp_lib_static) DFHACK_PLUGIN(pathable pathable.cpp LINK_LIBRARIES lua) From 6275905644921414fd1997afbe6724fb2594a65c Mon Sep 17 00:00:00 2001 From: Kelly Kinkade Date: Thu, 16 Aug 2018 11:33:59 -0500 Subject: [PATCH 5/5] nestboxes: Use buildings.others[NEST_BOX] Should minimize performance impact (not that it was much before) --- plugins/nestboxes.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/nestboxes.cpp b/plugins/nestboxes.cpp index 4276bef38..b527322c2 100644 --- a/plugins/nestboxes.cpp +++ b/plugins/nestboxes.cpp @@ -8,6 +8,7 @@ #include "df/ui.h" #include "df/building_nest_boxst.h" #include "df/building_type.h" +#include "df/buildings_other_id.h" #include "df/global_objects.h" #include "df/item.h" #include "df/unit.h" @@ -37,7 +38,7 @@ static void eggscan(color_ostream &out) { CoreSuspender suspend; - for (df::building *build : world->buildings.all) + for (df::building *build : world->buildings.other[df::buildings_other_id::NEST_BOX]) { auto type = build->getType(); if (df::enums::building_type::NestBox == type)