diff --git a/scripts/full-heal.lua b/scripts/full-heal.lua index 208082520..8de3f9eda 100644 --- a/scripts/full-heal.lua +++ b/scripts/full-heal.lua @@ -29,7 +29,11 @@ if args.help then return end -unit = df.unit.find(args.unit) or dfhack.gui.getSelectedUnit() +if(args.unit) then + unit = df.unit.find(args.unit) +else + unit = dfhack.gui.getSelectedUnit() +end if not unit then qerror('Error: please select a unit or pass its id as an argument.')