From 53e25d5eca34c869c25daed71bf04d888afdd646 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Sat, 21 Sep 2024 04:11:24 -0700 Subject: [PATCH 1/6] Update deep-embark.lua getUnitsInBox now only returns active units --- deep-embark.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deep-embark.lua b/deep-embark.lua index 1745774a9..dba12075c 100644 --- a/deep-embark.lua +++ b/deep-embark.lua @@ -161,7 +161,7 @@ function moveEmbarkStuff(selectedBlock, embarkTiles) local unitsAtSpawn = dfhack.units.getUnitsInBox(x1, y1, z1, x2, y2, z2) local movedUnit = false for i, unit in ipairs(unitsAtSpawn) do - if unit.civ_id == df.global.plotinfo.civ_id and not unit.flags1.inactive and not unit.flags2.killed then + if unit.civ_id == df.global.plotinfo.civ_id and not unit.flags2.killed then local pos = embarkTiles[math.random(1, #embarkTiles)] dfhack.units.teleport(unit, pos) reveal(pos) From e50fc2ed99479e1268b3421af4e929cd15cb325b Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Sat, 21 Sep 2024 04:32:02 -0700 Subject: [PATCH 2/6] Update reaction-trigger.lua Inactive units shouldn't use range if anybody updates this tool. --- modtools/reaction-trigger.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modtools/reaction-trigger.lua b/modtools/reaction-trigger.lua index c71e84f37..5514a0151 100644 --- a/modtools/reaction-trigger.lua +++ b/modtools/reaction-trigger.lua @@ -181,7 +181,7 @@ local validArgs = utils.invert({ 'allowMultipleTargets', 'range', 'ignoreWorker', - 'dontSkipInactive', + 'dontSkipInactive', --TODO: positions for inactive units are meaningless! 'resetPolicy' }) From b83d395940041d41a6bb7c31ee394c7404065e6f Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Sat, 21 Sep 2024 04:33:49 -0700 Subject: [PATCH 3/6] Update stuckdoors.lua getUnitsInBox now returns active by default --- fix/stuckdoors.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fix/stuckdoors.lua b/fix/stuckdoors.lua index 8e1e1bc02..ec48a847b 100644 --- a/fix/stuckdoors.lua +++ b/fix/stuckdoors.lua @@ -9,7 +9,7 @@ end -- Util function: find out if there are any units on the tile with coordinates x,y,z function unitOnTile(x, y, z) - local units = dfhack.units.getUnitsInBox(x,y,z,x,y,z,dfhack.units.isActive) + local units = dfhack.units.getUnitsInBox(x,y,z,x,y,z) return #(units) > 0 end From c39ab02d9f1d33dfd79949894d6696b9b2d621d7 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Sat, 21 Sep 2024 04:35:16 -0700 Subject: [PATCH 4/6] Update exterminate.rst Stray punctuation --- docs/exterminate.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/exterminate.rst b/docs/exterminate.rst index 664019aec..9ce66b979 100644 --- a/docs/exterminate.rst +++ b/docs/exterminate.rst @@ -43,7 +43,7 @@ Options ``-m``, ``--method `` Specifies the "method" of killing units. See below for details. ``-o``, ``--only-visible`` - Specifies the tool should only kill units visible to the player. + Specifies the tool should only kill units visible to the player on the map. ``-f``, ``--include-friendly`` Specifies the tool should also kill units friendly to the player. From 41128cafce5ac4e8899d2a943599719eba0ea6d2 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Sat, 21 Sep 2024 04:36:29 -0700 Subject: [PATCH 5/6] Update position.rst - Tag dfhack --- docs/position.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/position.rst b/docs/position.rst index 23a8cfe1e..9d06d3961 100644 --- a/docs/position.rst +++ b/docs/position.rst @@ -3,7 +3,7 @@ position .. dfhack-tool:: :summary: Report cursor and mouse position, along with other info. - :tags: adventure fort inspection map + :tags: adventure dfhack fort inspection map This tool reports the current date, clock time, month, season, and historical era. It also reports the keyboard cursor position (or just the z-level if no From c1b23c7e504e5a2ad7da7fc952a3612eaf26d092 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Sat, 28 Sep 2024 12:17:35 -0700 Subject: [PATCH 6/6] Separate PR * Update stuckdoors.lua * Update deep-embark.lua --- deep-embark.lua | 2 +- fix/stuckdoors.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deep-embark.lua b/deep-embark.lua index dba12075c..1745774a9 100644 --- a/deep-embark.lua +++ b/deep-embark.lua @@ -161,7 +161,7 @@ function moveEmbarkStuff(selectedBlock, embarkTiles) local unitsAtSpawn = dfhack.units.getUnitsInBox(x1, y1, z1, x2, y2, z2) local movedUnit = false for i, unit in ipairs(unitsAtSpawn) do - if unit.civ_id == df.global.plotinfo.civ_id and not unit.flags2.killed then + if unit.civ_id == df.global.plotinfo.civ_id and not unit.flags1.inactive and not unit.flags2.killed then local pos = embarkTiles[math.random(1, #embarkTiles)] dfhack.units.teleport(unit, pos) reveal(pos) diff --git a/fix/stuckdoors.lua b/fix/stuckdoors.lua index ec48a847b..8e1e1bc02 100644 --- a/fix/stuckdoors.lua +++ b/fix/stuckdoors.lua @@ -9,7 +9,7 @@ end -- Util function: find out if there are any units on the tile with coordinates x,y,z function unitOnTile(x, y, z) - local units = dfhack.units.getUnitsInBox(x,y,z,x,y,z) + local units = dfhack.units.getUnitsInBox(x,y,z,x,y,z,dfhack.units.isActive) return #(units) > 0 end