From f3862e3eecacd5af65d0799c49dcee6c3a964980 Mon Sep 17 00:00:00 2001 From: Kelly Kinkade Date: Mon, 27 Mar 2023 00:44:03 -0500 Subject: [PATCH] tailor: gatekeep debugging code --- docs/changelog.txt | 6 +++++- plugins/tailor.cpp | 15 +++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index 619a538e3..65194dcfa 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -44,7 +44,11 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: - `buildingplan`: you can no longer designate constructions on tiles with magma or deep water - `buildingplan`: fixed material filter getting lost for planning buildings on save/reload - `buildingplan`: respect building size limits (e.g. roads and bridges cannot be more than 31 tiles in any dimension) -- `tailor`: now properly discriminates between dyed and undyed cloth, no longer defaults to using adamantine, properly tracks material requirements for already queued orders, skips units who can't wear clothes, and hopefully won't over-order items anymore +- `tailor`: properly discriminates between dyed and undyed cloth +- `tailor`: no longer defaults to using adamantine +- `tailor`: properly tracks material requirements for already queued orders +- `tailor`: skips units who can't wear clothes +- `tailor`: hopefully won't over-order items any more ## Misc Improvements - `buildingplan`: filters and global settings are now ignored when manually choosing items for a building diff --git a/plugins/tailor.cpp b/plugins/tailor.cpp index 286bd9c0d..2b44d11ae 100644 --- a/plugins/tailor.cpp +++ b/plugins/tailor.cpp @@ -192,13 +192,16 @@ public: available[std::make_pair(t, size)] += 1; } - for (auto& i : available) + if (DBG_NAME(cycle).isEnabled(DebugCategory::LDEBUG)) { - df::item_type t; - int size; - std::tie(t, size) = i.first; - DEBUG(cycle).print("tailor: %d %s of size %d found\n", - i.second, ENUM_KEY_STR(item_type, t).c_str(), size); + for (auto& i : available) + { + df::item_type t; + int size; + std::tie(t, size) = i.first; + DEBUG(cycle).print("tailor: %d %s of size %d found\n", + i.second, ENUM_KEY_STR(item_type, t).c_str(), size); + } } }