Merge pull request #2658 from ab9rf/autofarm-5005-alpha2

autofarm: fix repetition in status output
develop
Myk 2023-01-18 15:51:36 -08:00 committed by GitHub
commit 4e88a9f562
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

@ -36,6 +36,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences:
## New Plugins
## Fixes
- `autofarm`: don't duplicate status line entries for crops with no current supply
- `orders`: allow the orders library to be listed and imported properly (if you previously copied the orders library into your ``dfhack-config/orders`` directory to work around this bug, you can remove those files now)
## Misc Improvements

@ -332,6 +332,7 @@ public:
void status(color_ostream& out)
{
out << "Autofarm is " << (enabled ? "Active." : "Stopped.") << '\n';
for (auto& lc : lastCounts)
{
auto plant = world->raws.plants.all[lc.first];
@ -340,7 +341,7 @@ public:
for (auto& th : thresholds)
{
if (lastCounts[th.first] > 0)
if (lastCounts.count(th.first) > 0)
continue;
auto plant = world->raws.plants.all[th.first];
out << plant->id << " limit " << getThreshold(th.first) << " current 0" << '\n';