From e6336e769a2625ee55c9435f2be5c773f758dc37 Mon Sep 17 00:00:00 2001 From: lethosor Date: Sun, 4 Sep 2022 23:08:56 -0400 Subject: [PATCH 1/2] Units::teleport(): set idle_area --- docs/changelog.txt | 1 + library/modules/Units.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/changelog.txt b/docs/changelog.txt index 895f7db72..813dfee77 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -80,6 +80,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: - Removed ``Windows`` module (C++-only) - unused. - ``Constructions`` module (C++-only): removed ``t_construction``, ``isValid()``, ``getCount()``, ``getConstruction()``, and ``copyConstruction()``. Access ``world.constructions`` directly instead. - ``Gui::getSelectedItem()``, ``Gui::getAnyItem()``: added support for the artifacts screen +- ``Units::teleport()``: now sets ``unit.idle_area`` ## Lua - History: added ``dfhack.getCommandHistory(history_id, history_filename)`` and ``dfhack.addCommandToHistory(history_id, history_filename, command)`` so gui scripts can access a commandline history without requiring a terminal. diff --git a/library/modules/Units.cpp b/library/modules/Units.cpp index 8e9f624ea..32b9f28e5 100644 --- a/library/modules/Units.cpp +++ b/library/modules/Units.cpp @@ -174,6 +174,7 @@ bool Units::teleport(df::unit *unit, df::coord target_pos) // move unit to destination unit->pos = target_pos; + unit->idle_area = target_pos; // move unit's riders (including babies) to destination if (unit->flags1.bits.ridden) From c1b9ffc7ca7cef93ebaa0554f39a1fb40d10ef77 Mon Sep 17 00:00:00 2001 From: lethosor Date: Sat, 24 Sep 2022 13:31:18 -0400 Subject: [PATCH 2/2] Clarify changelog Based on clarification from Doublestrafe and Quietust --- docs/changelog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index 813dfee77..b7d822801 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -80,7 +80,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: - Removed ``Windows`` module (C++-only) - unused. - ``Constructions`` module (C++-only): removed ``t_construction``, ``isValid()``, ``getCount()``, ``getConstruction()``, and ``copyConstruction()``. Access ``world.constructions`` directly instead. - ``Gui::getSelectedItem()``, ``Gui::getAnyItem()``: added support for the artifacts screen -- ``Units::teleport()``: now sets ``unit.idle_area`` +- ``Units::teleport()``: now sets ``unit.idle_area`` to discourage units from walking back to their original location (or teleporting back, if using `fastdwarf`) ## Lua - History: added ``dfhack.getCommandHistory(history_id, history_filename)`` and ``dfhack.addCommandToHistory(history_id, history_filename, command)`` so gui scripts can access a commandline history without requiring a terminal.