diff --git a/docs/changelog.txt b/docs/changelog.txt index e45273a253..97bc202fee 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -41,6 +41,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: - Fix extra keys appearing in DFHack text boxes when shift (or any other modifier) is released before the other key you were pressing - `logistics`: don't autotrain domestic animals brought by invaders (they'll get attacked by friendly creatures as soon as you let them out of their cage) - `logistics`: don't bring trade goods to depot if the only caravans present are tribute caravans +- `gui/create-item`: when choosing a citizen to create the chosen items, avoid choosing a dead citizen ## Misc Improvements - `stockpiles`: include exotic pets in the "tameable" filter diff --git a/docs/dev/Lua API.rst b/docs/dev/Lua API.rst index 2cf1df52aa..7aea41c551 100644 --- a/docs/dev/Lua API.rst +++ b/docs/dev/Lua API.rst @@ -1454,8 +1454,7 @@ Units module * ``dfhack.units.getCitizens([ignore_sanity])`` - Returns a table (list) of all citizens, which you would otherwise have to - loop over all units in world and test against ``isCitizen()`` to discover. + Returns a list of all living citizens. * ``dfhack.units.teleport(unit, pos)`` diff --git a/library/modules/Units.cpp b/library/modules/Units.cpp index ed667b2a21..f517a07b55 100644 --- a/library/modules/Units.cpp +++ b/library/modules/Units.cpp @@ -841,7 +841,7 @@ df::unit *Units::getUnitByNobleRole(string noble) { bool Units::getCitizens(std::vector &citizens, bool ignore_sanity) { for (auto &unit : world->units.active) { - if (isCitizen(unit, ignore_sanity)) + if (isCitizen(unit, ignore_sanity) && isAlive(unit)) citizens.emplace_back(unit); } return true;