From f17f46d0c7ebad59999e9b754ac3275caaa686a9 Mon Sep 17 00:00:00 2001 From: kane-t Date: Sun, 19 Jul 2015 18:55:03 -0300 Subject: [PATCH] Update set-orientation.lua --- set-orientation.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/set-orientation.lua b/set-orientation.lua index 41abaf6..a225024 100644 --- a/set-orientation.lua +++ b/set-orientation.lua @@ -11,6 +11,10 @@ local unit = nil if args.unit and tonumber(args.unit) then -- Check for unit declaration !REQUIRED unit = df.unit.find(tonumber(args.unit)) else + unit = dfhack.gui.getSelectedUnit() +end + +if unit == nil then print('No unit selected') return end