Merge pull request #2276 from lethosor/teleport-set-idle-area

`Units::teleport()`: set idle_area
develop
Myk 2022-09-24 16:09:17 -07:00 committed by GitHub
commit 54dc0e36f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

@ -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`` 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.

@ -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)