From 6e1ab8d67b2063bee595bbdc422c37c73c4ff368 Mon Sep 17 00:00:00 2001 From: gearsix Date: Thu, 26 Jan 2023 18:58:25 +0000 Subject: [PATCH 01/14] issue #1805 - made getplants input case-insensitive Now `toUpper` is called on user input when it's added to `plantNames` to ensure it matches the ID fields which are all in upper-case. --- plugins/getplants.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/getplants.cpp b/plugins/getplants.cpp index 4fc82cb97..485dff967 100644 --- a/plugins/getplants.cpp +++ b/plugins/getplants.cpp @@ -7,6 +7,7 @@ #include "PluginManager.h" #include "DataDefs.h" #include "TileTypes.h" +#include "MiscUtils.h" #include "df/map_block.h" #include "df/map_block_column.h" @@ -395,7 +396,7 @@ command_result df_getplants (color_ostream &out, vector & parameters) } } else - plantNames.insert(parameters[i]); + plantNames.insert(toUpper(parameters[i])); } if (treesonly && shrubsonly) { From 6726b567a1224e22a9515fec5ec96b53c9b626ca Mon Sep 17 00:00:00 2001 From: gearsix Date: Fri, 27 Jan 2023 14:19:29 +0000 Subject: [PATCH 02/14] issue #2043 - `designate` now marks trees (regardless of if ripe). The `ripe` call was returning false on tree tiles, resulting in an inability to designate trees for chopping with `getplants`. This change adds a check to see if the tile is a tree or not and if it is, then the ripe check is ignored. --- plugins/getplants.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/getplants.cpp b/plugins/getplants.cpp index 485dff967..565316fa6 100644 --- a/plugins/getplants.cpp +++ b/plugins/getplants.cpp @@ -322,9 +322,9 @@ bool designate(const df::plant *plant, bool farming) { } } - if ((!farming || seedSource) && - ripe(plant->pos.x, plant->pos.y, plant_raw->growths[i]->timing_1, plant_raw->growths[i]->timing_2) && - !picked(plant, i)) + bool istree = (tileMaterial(Maps::getTileBlock(plant->pos)->tiletype[plant->pos.x % 16][plant->pos.y % 16]) == tiletype_material::TREE); + bool isripe = ripe(plant->pos.x, plant->pos.y, plant_raw->growths[i]->timing_1, plant_raw->growths[i]->timing_2); + if ((!farming || seedSource) && (istree || isripe) && !picked(plant, i)) { return Designations::markPlant(plant); } @@ -429,7 +429,7 @@ command_result df_getplants (color_ostream &out, vector & parameters) // plantSelections[i] = selectablePlant(out, plant, farming); plantSelections[i] = selectablePlant(plant, farming); } - else if (plantNames.find(plant->id) != plantNames.end()) + else if (plantNames.find(plant->id) != plantNames.end()) { plantNames.erase(plant->id); // plantSelections[i] = selectablePlant(out, plant, farming); From 863ca2ca65ffe1d9f7367ade656ef97f2174a2a1 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Sat, 28 Jan 2023 08:02:46 -0800 Subject: [PATCH 03/14] solve the inception problem where hideGuard smashes the viewscreen stack with multiple insertions for the same screen --- library/include/modules/Screen.h | 5 +-- library/modules/Screen.cpp | 54 ++++++++++++++++++-------------- 2 files changed, 33 insertions(+), 26 deletions(-) diff --git a/library/include/modules/Screen.h b/library/include/modules/Screen.h index 9417d60e9..48f34888f 100644 --- a/library/include/modules/Screen.h +++ b/library/include/modules/Screen.h @@ -318,9 +318,10 @@ namespace DFHack static const int RESTORE_AT_TOP = 0x1; private: - void extract(df::viewscreen*); - void merge(df::viewscreen*); + void extract(); + void merge(); df::viewscreen* screen; + df::viewscreen* prev_parent; int flags; }; } diff --git a/library/modules/Screen.cpp b/library/modules/Screen.cpp index 3ece27b78..f056a8578 100644 --- a/library/modules/Screen.cpp +++ b/library/modules/Screen.cpp @@ -527,43 +527,49 @@ void Screen::raise(df::viewscreen *screen) { namespace DFHack { namespace Screen { Hide::Hide(df::viewscreen* screen, int flags) : - screen{screen}, flags{flags} -{ - extract(screen); + screen{screen}, prev_parent{nullptr}, flags{flags} { + if (!screen) + return; + + // don't extract a screen that's not even in the stack + if (screen->parent) + extract(); } -Hide::~Hide() -{ +Hide::~Hide() { if (screen) - merge(screen); + merge(); } -void Hide::extract(df::viewscreen* a) -{ - df::viewscreen* ap = a->parent; - df::viewscreen* ac = a->child; +void Hide::extract() { + prev_parent = screen->parent; + df::viewscreen *prev_child = screen->child; - ap->child = ac; - if (ac) ac->parent = ap; - else Core::getInstance().top_viewscreen = ap; + screen->parent = nullptr; + screen->child = nullptr; + + prev_parent->child = prev_child; + if (prev_child) prev_child->parent = prev_parent; + else Core::getInstance().top_viewscreen = prev_parent; } -void Hide::merge(df::viewscreen* a) -{ +void Hide::merge() { + if (screen->parent) { + // we're somehow back on the stack; do nothing + return; + } + if (flags & RESTORE_AT_TOP) { - a->parent = NULL; - a->child = NULL; - Screen::show(std::unique_ptr(a)); + Screen::show(std::unique_ptr(screen)); return; } - df::viewscreen* ap = a->parent; - df::viewscreen* ac = a->parent->child; + df::viewscreen* new_child = prev_parent->child; - ap->child = a; - a->child = ac; - if (ac) ac->parent = a; - else Core::getInstance().top_viewscreen = a; + prev_parent->child = screen; + screen->child = new_child; + if (new_child) new_child->parent = screen; + else Core::getInstance().top_viewscreen = screen; } } } From 25ff01549747b2fbd4456f1823e624b491990b3d Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Sat, 28 Jan 2023 08:04:36 -0800 Subject: [PATCH 04/14] update changelog --- docs/changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelog.txt b/docs/changelog.txt index 8d84e3cff..49e3afc70 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -37,6 +37,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: ## Fixes - Fix issues with clicks "passing through" some DFHack window elements, like scrollbars +-@ ``Screen``: allow `gui/launcher` and `gui/quickcmd` to launch themselves without hanging the game ## Misc Improvements - A new cross-compile build script was added for building the Windows files from a Linux Docker builder (see the Compile instructions in the docs) From 21ebd778b1774716b68022058f59375ce3a6e3ec Mon Sep 17 00:00:00 2001 From: gearsix Date: Sat, 28 Jan 2023 22:05:36 +0000 Subject: [PATCH 05/14] updated changelog --- docs/changelog.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/changelog.txt b/docs/changelog.txt index 8d84e3cff..3db740589 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -37,6 +37,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: ## Fixes - Fix issues with clicks "passing through" some DFHack window elements, like scrollbars +- `plugin/getplants`: tree are now designated correctly ## Misc Improvements - A new cross-compile build script was added for building the Windows files from a Linux Docker builder (see the Compile instructions in the docs) @@ -46,6 +47,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: - `gui/quickcmd`: now has it's own global keybinding for your convenience: Ctrl-Shift-A - Many DFHack windows can now be unfocused by clicking somewhere not over the tool window. This has the same effect as pinning previously did, but without the extra clicking. - `overlay`: overlay widgets can now specify a default enabled state if they are not already set in the player's overlay config file +- `plugin/getplants`: ID values will now be accepted regardless of case ## Documentation From 6dc74f201df1b0ef3f63d6728eb614bd1bf9a1e9 Mon Sep 17 00:00:00 2001 From: DFHack-Urist via GitHub Actions <63161697+DFHack-Urist@users.noreply.github.com> Date: Sun, 29 Jan 2023 07:13:24 +0000 Subject: [PATCH 06/14] Auto-update submodules library/xml: master scripts: master --- library/xml | 2 +- scripts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/library/xml b/library/xml index cf659eb0a..a3b6cd550 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit cf659eb0a0bc064208fcfeb4695ecee22e253d9f +Subproject commit a3b6cd5507753207ce28fe0872c98d6434d58a90 diff --git a/scripts b/scripts index 3193ad5c3..bf914ddd8 160000 --- a/scripts +++ b/scripts @@ -1 +1 @@ -Subproject commit 3193ad5c354a18cb55d41792379894b7b054c7bc +Subproject commit bf914ddd8c58011368f72172f9d158d0043c61fc From c2d6debcd8bac2a93ba9e17a918cff601a9b68bd Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Sat, 28 Jan 2023 23:59:36 -0800 Subject: [PATCH 07/14] add on/off light textures and expose to lua --- data/art/on-off.png | Bin 0 -> 273 bytes library/LuaApi.cpp | 1 + library/include/modules/Textures.h | 5 +++++ library/modules/Textures.cpp | 7 +++++++ 4 files changed, 13 insertions(+) create mode 100644 data/art/on-off.png diff --git a/data/art/on-off.png b/data/art/on-off.png new file mode 100644 index 0000000000000000000000000000000000000000..2b731e1c6b89ab99485a34c31cf65d6b9cd949b1 GIT binary patch literal 273 zcmeAS@N?(olHy`uVBq!ia0vp^0zk~e!2~3qw63}aq$EpRBT9nv(@M${i&7aJQ}UBi z6+Ckj(^G>|6H_V+Po~-c70vW?aSW-rl{97I#6$&F1ICZ)-u%=4nO3>WISWkSo_JV~ zZ;NB%SI+h9|Lg0Gn3Z;a&TsT!<576T Date: Sun, 29 Jan 2023 00:35:12 -0800 Subject: [PATCH 08/14] use new icons in pathable --- plugins/pathable.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/pathable.cpp b/plugins/pathable.cpp index b66099a1f..dd26a712f 100644 --- a/plugins/pathable.cpp +++ b/plugins/pathable.cpp @@ -1,6 +1,7 @@ #include "modules/Gui.h" #include "modules/Maps.h" #include "modules/Screen.h" +#include "modules/Textures.h" #include "Debug.h" #include "LuaTools.h" @@ -38,6 +39,11 @@ static void paintScreen(df::coord target, bool skip_unrevealed = false) { long pathable_tile_texpos = 779; long unpathable_tile_texpos = 782; + long on_off_texpos = Textures::getOnOffTexposStart(); + if (on_off_texpos > 0) { + pathable_tile_texpos = on_off_texpos + 0; + unpathable_tile_texpos = on_off_texpos + 1; + } auto dims = Gui::getDwarfmodeViewDims().map(); for (int y = dims.first.y; y <= dims.second.y; ++y) { From 4c455224f9d45f0e6dca27e35820d575e03dea67 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Fri, 27 Jan 2023 14:57:45 -0800 Subject: [PATCH 09/14] make initial pause configurable --- docs/changelog.txt | 1 + docs/dev/Lua API.rst | 7 +++++-- library/lua/gui.lua | 10 +++++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index 5eb73c15b..215d5de5e 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: ## Misc Improvements - A new cross-compile build script was added for building the Windows files from a Linux Docker builder (see the Compile instructions in the docs) +- You can now configure whether DFHack tool windows should pause the game by default - `hotkeys`: clicking on the DFHack logo no longer closes the popup menu - `gui/launcher`: sped up initialization time for faster load of the UI - `orders`: orders plugin functionality is now offered via an overlay widget when the manager orders screen is open diff --git a/docs/dev/Lua API.rst b/docs/dev/Lua API.rst index a21ed0aba..ec162f6ec 100644 --- a/docs/dev/Lua API.rst +++ b/docs/dev/Lua API.rst @@ -4182,9 +4182,12 @@ ZScreen provides the following functions: ZScreen subclasses can set the following attributes: -* ``initial_pause`` (default: ``true``) +* ``initial_pause`` (default: ``DEFAULT_INITIAL_PAUSE``) - Whether to pause the game when the ZScreen is shown. + Whether to pause the game when the ZScreen is shown. ``DEFAULT_INITIAL_PAUSE`` + defaults to ``true`` but can be set via running a command like:: + + :lua require('gui.widgets').DEFAULT_INITIAL_PAUSE = false * ``force_pause`` (default: ``false``) diff --git a/library/lua/gui.lua b/library/lua/gui.lua index 2cb84d682..233496b82 100644 --- a/library/lua/gui.lua +++ b/library/lua/gui.lua @@ -693,17 +693,25 @@ end -- Z-order swapping screen -- ----------------------------- +DEFAULT_INITIAL_PAUSE = true + local zscreen_inhibit_mouse_l = false ZScreen = defclass(ZScreen, Screen) ZScreen.ATTRS{ - initial_pause=true, + initial_pause=DEFAULT_NIL, force_pause=false, pass_pause=true, pass_movement_keys=false, pass_mouse_clicks=true, } +function ZScreen:preinit(args) + if args.initial_pause == nil then + args.initial_pause = DEFAULT_INITIAL_PAUSE + end +end + function ZScreen:init() self.saved_pause_state = df.global.pause_state if self.initial_pause then From 8d4990b8fd4808b9b2d37ebfe10b814fc51267ee Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Sun, 29 Jan 2023 00:55:49 -0800 Subject: [PATCH 10/14] don't autorefresh the enableable tools list it just takes too long (>1s) to refresh every time. manual refresh with script_manager.reload() is still available for devs who need it --- library/lua/script-manager.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/library/lua/script-manager.lua b/library/lua/script-manager.lua index c1b8c80d5..cc5dd9fe3 100644 --- a/library/lua/script-manager.lua +++ b/library/lua/script-manager.lua @@ -24,7 +24,7 @@ function foreach_module_script(cb) end end -local enabled_map = {} +local enabled_map = nil local function process_script(env_name, env) local global_name = 'isEnabled' @@ -44,10 +44,14 @@ function reload() foreach_module_script(process_script) end +local function ensure_loaded() + if not enabled_map then + reload() + end +end + function list() - -- call reload every time we list to make sure we get scripts that have - -- just been added - reload() + ensure_loaded() for name,fn in pairs(enabled_map) do print(('%21s %-3s'):format(name..':', fn() and 'on' or 'off')) end From 549ccfa3c0b9d25b05ecf4b9a81561af4591a344 Mon Sep 17 00:00:00 2001 From: Myk Date: Sun, 29 Jan 2023 10:53:05 -0800 Subject: [PATCH 11/14] Apply suggestions from code review --- docs/changelog.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index 6db8e0616..f7fe08455 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -37,7 +37,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: ## Fixes -@ Fix issues with clicks "passing through" some DFHack window elements, like scrollbars -- `plugin/getplants`: tree are now designated correctly +- `getplants`: tree are now designated correctly ## Misc Improvements - A new cross-compile build script was added for building the Windows files from a Linux Docker builder (see the Compile instructions in the docs) @@ -47,7 +47,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: - `gui/quickcmd`: now has it's own global keybinding for your convenience: Ctrl-Shift-A - Many DFHack windows can now be unfocused by clicking somewhere not over the tool window. This has the same effect as pinning previously did, but without the extra clicking. - `overlay`: overlay widgets can now specify a default enabled state if they are not already set in the player's overlay config file -- `plugin/getplants`: ID values will now be accepted regardless of case +- `getplants`: ID values will now be accepted regardless of case -@ New borders for DFHack tool windows -- tell us what you think! ## Documentation From 9141c7e008b1c784bed3465d0226cd1f2f5bc6bd Mon Sep 17 00:00:00 2001 From: Myk Date: Sun, 29 Jan 2023 11:25:06 -0800 Subject: [PATCH 12/14] remove duplicate args --- build/win64/generate-MSVC-gui.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/win64/generate-MSVC-gui.bat b/build/win64/generate-MSVC-gui.bat index cd22c4e75..71bc1dd14 100644 --- a/build/win64/generate-MSVC-gui.bat +++ b/build/win64/generate-MSVC-gui.bat @@ -1,5 +1,5 @@ IF EXIST DF_PATH.txt SET /P _DF_PATH= Date: Sun, 29 Jan 2023 16:26:14 -0800 Subject: [PATCH 13/14] add dfhack.units.getCitizens() --- docs/changelog.txt | 2 ++ docs/dev/Lua API.rst | 5 +++++ library/LuaApi.cpp | 12 ++++++++++++ library/include/modules/Units.h | 1 + library/modules/Units.cpp | 8 ++++++++ 5 files changed, 28 insertions(+) diff --git a/docs/changelog.txt b/docs/changelog.txt index eb5ba2710..14c78883b 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -55,11 +55,13 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: ## API - ``Buildings::containsTile()``: no longer takes a ``room`` parameter since that's not how rooms work anymore. If the building has extents, the extents will be checked. otherwise, the result just depends on whether the tile is within the building's bounding box. +- ``Units::getCitizens()``: gets a list of citizens, which otherwise you'd have to iterate over all units the world to discover ## Lua - `helpdb`: new function: ``helpdb.refresh()`` to force a refresh of the database. Call if you are a developer adding new scripts, loading new plugins, or changing help text during play - `helpdb`: changed from auto-refreshing every 60 seconds to only refreshing on explicit call to ``helpdb.refresh()``. docs very rarely change during a play session, and the automatic database refreshes were slowing down the startup of `gui/launcher` - ``widgets.Label``: ``label.scroll()`` now understands ``home`` and ``end`` keywords for scrolling to the top or bottom +- ``dfhack.units.getCitizens()``: gets a list of citizens ## Removed diff --git a/docs/dev/Lua API.rst b/docs/dev/Lua API.rst index a21ed0aba..555b7b1a9 100644 --- a/docs/dev/Lua API.rst +++ b/docs/dev/Lua API.rst @@ -1412,6 +1412,11 @@ Units module Note that ``pos2xyz()`` cannot currently be used to convert coordinate objects to the arguments required by this function. +* ``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. + * ``dfhack.units.teleport(unit, pos)`` Moves the specified unit and any riders to the target coordinates, setting diff --git a/library/LuaApi.cpp b/library/LuaApi.cpp index 421821c05..8641e8aaf 100644 --- a/library/LuaApi.cpp +++ b/library/LuaApi.cpp @@ -1883,6 +1883,17 @@ static int units_getUnitsInBox(lua_State *state) return 2; } +static int units_getCitizens(lua_State *L) { + bool ignore_sanity = lua_toboolean(L, -1); // defaults to false + + std::vector citizens; + if (Units::getCitizens(citizens, ignore_sanity)) { + Lua::PushVector(L, citizens); + return 1; + } + return 0; +} + static int units_getStressCutoffs(lua_State *L) { lua_newtable(L); @@ -1896,6 +1907,7 @@ static const luaL_Reg dfhack_units_funcs[] = { { "getOuterContainerRef", units_getOuterContainerRef }, { "getNoblePositions", units_getNoblePositions }, { "getUnitsInBox", units_getUnitsInBox }, + { "getCitizens", units_getCitizens }, { "getStressCutoffs", units_getStressCutoffs }, { NULL, NULL } }; diff --git a/library/include/modules/Units.h b/library/include/modules/Units.h index 3cdc9264a..442f3d009 100644 --- a/library/include/modules/Units.h +++ b/library/include/modules/Units.h @@ -145,6 +145,7 @@ DFHACK_EXPORT df::unit *getUnit(const int32_t index); DFHACK_EXPORT bool getUnitsInBox(std::vector &units, int16_t x1, int16_t y1, int16_t z1, int16_t x2, int16_t y2, int16_t z2); +DFHACK_EXPORT bool getCitizens(std::vector &citizens, bool ignore_sanity = false); DFHACK_EXPORT int32_t findIndexById(int32_t id); diff --git a/library/modules/Units.cpp b/library/modules/Units.cpp index a60803800..abb35b9e0 100644 --- a/library/modules/Units.cpp +++ b/library/modules/Units.cpp @@ -756,6 +756,14 @@ bool Units::getUnitsInBox (std::vector &units, return true; } +bool Units::getCitizens(std::vector &citizens, bool ignore_sanity) { + for (auto &unit : world->units.active) { + if (isCitizen(unit, ignore_sanity)) + citizens.emplace_back(unit); + } + return true; +} + int32_t Units::findIndexById(int32_t creature_id) { return df::unit::binsearch_index(world->units.all, creature_id); From f1e8ee1b0a2fcdf1720da504f80792ec66a15f2d Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Sun, 29 Jan 2023 16:28:56 -0800 Subject: [PATCH 14/14] use new API in autochop --- plugins/autochop.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/plugins/autochop.cpp b/plugins/autochop.cpp index 34a8979ff..e44b4f804 100644 --- a/plugins/autochop.cpp +++ b/plugins/autochop.cpp @@ -369,13 +369,6 @@ static void bucket_tree(df::plant *plant, bool designate_clearcut, bool *designa *can_chop = true; } -static void get_citizens(vector &vec) { - for (auto &unit : world->units.active) { - if (Units::isCitizen(unit)) - vec.emplace_back(unit); - } -} - static void bucket_watched_burrows(color_ostream & out, map &clearcut_burrows, map &chop_burrows) { @@ -546,7 +539,7 @@ static int32_t do_cycle(color_ostream &out, bool force_designate) { int32_t expected_yield; TreesBySize designatable_trees_by_size; vector citizens; - get_citizens(citizens); + Units::getCitizens(citizens); int32_t newly_marked = scan_trees(out, &expected_yield, &designatable_trees_by_size, true, citizens); @@ -634,7 +627,7 @@ static void autochop_printStatus(color_ostream &out) { int32_t designated_trees, expected_yield, accessible_yield; map tree_counts, designated_tree_counts; vector citizens; - get_citizens(citizens); + Units::getCitizens(citizens); scan_logs(&usable_logs, citizens, &inaccessible_logs); scan_trees(out, &expected_yield, NULL, false, citizens, &accessible_trees, &inaccessible_trees, &designated_trees, &accessible_yield, &tree_counts, &designated_tree_counts); @@ -739,7 +732,7 @@ static int autochop_getLogCounts(lua_State *L) { DEBUG(status,*out).print("entering autochop_getNumLogs\n"); int32_t usable_logs, inaccessible_logs; vector citizens; - get_citizens(citizens); + Units::getCitizens(citizens); scan_logs(&usable_logs, citizens, &inaccessible_logs); Lua::Push(L, usable_logs); Lua::Push(L, inaccessible_logs); @@ -778,7 +771,7 @@ static int autochop_getTreeCountsAndBurrowConfigs(lua_State *L) { int32_t designated_trees, expected_yield, accessible_yield; map tree_counts, designated_tree_counts; vector citizens; - get_citizens(citizens); + Units::getCitizens(citizens); scan_trees(*out, &expected_yield, NULL, false, citizens, &accessible_trees, &inaccessible_trees, &designated_trees, &accessible_yield, &tree_counts, &designated_tree_counts);