@@ -346,14 +346,14 @@ end},
346346 return true
347347end },
348348{name = " follow" ,f = function (unit_list )
349- local adv = df . global . world .units . active [ 0 ]
349+ local adv = dfhack . world .getAdventurer ()
350350 for k ,v in pairs (unit_list ) do
351351 v .relationship_ids .GroupLeader = adv .id
352352 end
353353 return true
354354end },
355355{name = " leave" ,f = function (unit_list )
356- local adv = df . global . world .units . active [ 0 ]
356+ local adv = dfhack . world .getAdventurer ()
357357 local t_nem = dfhack .units .getNemesis (adv )
358358 for k ,v in pairs (unit_list ) do
359359
@@ -398,7 +398,7 @@ end},
398398 if not CheckCursor (pos ) then
399399 return false
400400 end
401- adv = df . global . world .units . active [ 0 ]
401+ adv = dfhack . world .getAdventurer ()
402402 item = GetItemsAtPos (df .global .cursor )[1 ]
403403 print (item .id )
404404 for k ,v in pairs (unit_list ) do
@@ -413,7 +413,7 @@ end},
413413}
414414
415415function getCompanions (unit )
416- unit = unit or df . global . world .units . active [ 0 ]
416+ unit = unit or dfhack . world .getAdventurer ()
417417 local t_nem = dfhack .units .getNemesis (unit )
418418 if t_nem == nil then
419419 qerror (" Invalid unit! No nemesis record" )
0 commit comments