properly store the id of seed targets in persisted state

develop
Myk Taylor 2023-02-12 03:06:53 -08:00
parent 50e9ad93f3
commit 0c989634ab
No known key found for this signature in database
2 changed files with 2 additions and 0 deletions

@ -38,6 +38,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences:
## Fixes ## Fixes
-@ `nestboxes`: fixed bug causing nestboxes themselves to be forbidden, which prevented citizens from using them to lay eggs. Now only eggs are forbidden. -@ `nestboxes`: fixed bug causing nestboxes themselves to be forbidden, which prevented citizens from using them to lay eggs. Now only eggs are forbidden.
- `autobutcher`: implemented work-around for Dwarf Fortress not setting nicknames properly, so that nicknames created in the in-game interface are detected & protect animals from being butchered properly. Note that nicknames for unnamed units are not currently saved by dwarf fortress - use ``enable fix/protect-nicks`` to fix any nicknames created/removed within dwarf fortress so they can be saved/reloaded when you reload the game. - `autobutcher`: implemented work-around for Dwarf Fortress not setting nicknames properly, so that nicknames created in the in-game interface are detected & protect animals from being butchered properly. Note that nicknames for unnamed units are not currently saved by dwarf fortress - use ``enable fix/protect-nicks`` to fix any nicknames created/removed within dwarf fortress so they can be saved/reloaded when you reload the game.
- `seedwatch`: fix saving and loading of seed stock targets
## Misc Improvements ## Misc Improvements

@ -85,6 +85,7 @@ static PersistentDataItem & ensure_seed_config(color_ostream &out, int id) {
string keyname = SEED_CONFIG_KEY_PREFIX + int_to_string(id); string keyname = SEED_CONFIG_KEY_PREFIX + int_to_string(id);
DEBUG(config,out).print("creating new persistent key for seed type %d\n", id); DEBUG(config,out).print("creating new persistent key for seed type %d\n", id);
watched_seeds.emplace(id, World::GetPersistentData(keyname, NULL)); watched_seeds.emplace(id, World::GetPersistentData(keyname, NULL));
set_config_val(watched_seeds[id], SEED_CONFIG_ID, id);
return watched_seeds[id]; return watched_seeds[id];
} }
static void remove_seed_config(color_ostream &out, int id) { static void remove_seed_config(color_ostream &out, int id) {