Fix for getSelectedCreature in adv mode.

develop
Warmist 2012-04-03 21:47:54 +03:00
parent 8e1d26ff97
commit 3a0bd73315
1 changed files with 3 additions and 0 deletions

@ -468,6 +468,9 @@ function ParseNames(path)
return ret
end
function getSelectedUnit()
if df.global.ui.main.mode~=23 then
return nil
end
local unit_indx=df.global.ui_selected_unit
if unit_indx<#df.global.world.units.other[0]-1 then
return df.global.world.units.other[0][unit_indx]