From 9f648d532ee29897dbf3acd5bfafb4d15b7932fd Mon Sep 17 00:00:00 2001 From: myk002 Date: Sun, 31 Jul 2022 14:22:21 -0700 Subject: [PATCH] modify seedwatch all to actually watch all seeds --- docs/changelog.txt | 1 + plugins/seedwatch.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index 2733cd539..637dd03f0 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -51,6 +51,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: - ``materials.ItemTraitsDialog``: added a default ``on_select``-handler which toggles the traits. - `orders`: added useful library of manager orders. see them with ``orders list`` and import them with, for example, ``orders import library/basic`` - `prospect`: add new ``--show`` option to give the player control over which report sections are shown. e.g. ``prospect all --show ores`` will just show information on ores. +- `seedwatch`: ``seedwatch all`` now adds all plants with seeds to the watchlist, not just the "basic" crops. ## Documentation diff --git a/plugins/seedwatch.cpp b/plugins/seedwatch.cpp index 478a0899a..65b89cfa1 100644 --- a/plugins/seedwatch.cpp +++ b/plugins/seedwatch.cpp @@ -132,7 +132,9 @@ command_result df_seedwatch(color_ostream &out, vector& parameters) map plantIDs; for(size_t i = 0; i < world->raws.plants.all.size(); ++i) { - plantIDs[world->raws.plants.all[i]->id] = i; + auto & plant = world->raws.plants.all[i]; + if (plant->material_defs.type[plant_material_def::seed] != -1) + plantIDs[plant->id] = i; } t_gamemodes gm; @@ -226,10 +228,8 @@ command_result df_seedwatch(color_ostream &out, vector& parameters) if(limit < 0) limit = 0; if(parameters[0] == "all") { - for(auto i = abbreviations.begin(); i != abbreviations.end(); ++i) - { - if(plantIDs.count(i->second) > 0) Kitchen::setLimit(plantIDs[i->second], limit); - } + for(auto & entry : plantIDs) + Kitchen::setLimit(entry.second, limit); } else {