modify seedwatch all to actually watch all seeds

develop
myk002 2022-07-31 14:22:21 -07:00 committed by Myk
parent 09401ac370
commit 9f648d532e
2 changed files with 6 additions and 5 deletions

@ -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. - ``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`` - `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. - `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 ## Documentation

@ -132,7 +132,9 @@ command_result df_seedwatch(color_ostream &out, vector<string>& parameters)
map<string, int32_t> plantIDs; map<string, int32_t> plantIDs;
for(size_t i = 0; i < world->raws.plants.all.size(); ++i) 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; t_gamemodes gm;
@ -226,10 +228,8 @@ command_result df_seedwatch(color_ostream &out, vector<string>& parameters)
if(limit < 0) limit = 0; if(limit < 0) limit = 0;
if(parameters[0] == "all") if(parameters[0] == "all")
{ {
for(auto i = abbreviations.begin(); i != abbreviations.end(); ++i) for(auto & entry : plantIDs)
{ Kitchen::setLimit(entry.second, limit);
if(plantIDs.count(i->second) > 0) Kitchen::setLimit(plantIDs[i->second], limit);
}
} }
else else
{ {