Skip to content

Commit 97da3a8

Browse files
committed
migrate users of teleport to dfhack.units.teleport
1 parent ebccb3b commit 97da3a8

3 files changed

Lines changed: 3 additions & 7 deletions

File tree

deep-embark.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ Usage::
5353
]====]
5454

5555
local utils = require 'utils'
56-
local teleport = reqscript("teleport").teleport
5756

5857
function getFeatureID(cavernType)
5958
local features = df.global.world.features
@@ -220,7 +219,7 @@ function moveEmbarkStuff(selectedBlock, embarkTiles)
220219
for i, unit in ipairs(unitsAtSpawn) do
221220
if unit.civ_id == df.global.ui.civ_id and not unit.flags1.inactive and not unit.flags2.killed then
222221
local pos = embarkTiles[math.random(1, #embarkTiles)]
223-
teleport(unit, pos)
222+
dfhack.units.teleport(unit, pos)
224223
reveal(pos)
225224
movedUnit = true
226225
end

flashstep.lua

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ A hotkey-friendly teleport that places your adventurer where your cursor is.
77
88
]====]
99

10-
local teleport = reqscript("teleport").teleport
11-
1210
function flashstep()
1311
local unit = df.global.world.units.active[0]
1412
if df.global.ui_advmode.menu ~= df.ui_advmode_menu.Look then
1513
qerror("No [l] cursor located! You kinda need it for this script.")
1614
end
17-
teleport(unit, xyz2pos(pos2xyz(df.global.cursor)))
15+
dfhack.units.teleport(unit, xyz2pos(pos2xyz(df.global.cursor)))
1816
dfhack.maps.getTileBlock(unit.pos).designation[unit.pos.x%16][unit.pos.y%16].hidden = false
1917
end
2018

gui/teleport.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ using the in-game cursor.
1111
]====]
1212

1313
guidm = require 'gui.dwarfmode'
14-
teleport = reqscript 'teleport'
1514
widgets = require 'gui.widgets'
1615

1716
function uiMultipleUnits()
@@ -67,7 +66,7 @@ function TeleportSidebar:choose()
6766
self.in_pick_pos = true
6867
df.global.ui.main.mode = df.ui_sidebar_mode.LookAround
6968
else
70-
teleport.teleport(self.unit, xyz2pos(pos2xyz(df.global.cursor)))
69+
dfhack.units.teleport(self.unit, xyz2pos(pos2xyz(df.global.cursor)))
7170
self:dismiss()
7271
end
7372
end

0 commit comments

Comments
 (0)