diff options
| author | Alexander Gavrilov | 2012-04-26 12:03:56 +0400 |
|---|---|---|
| committer | Alexander Gavrilov | 2012-04-26 12:03:56 +0400 |
| commit | 6ab270d129e098f0200824a798ad2117a6ec33c8 (patch) | |
| tree | 810653df30a44eb8054587e85da91b1a2eb72883 /plugins/lua | |
| parent | 9489c6ed1afd33790adc2e0b4e3c0152da8203e0 (diff) | |
| download | dfhack-6ab270d129e098f0200824a798ad2117a6ec33c8.tar.gz dfhack-6ab270d129e098f0200824a798ad2117a6ec33c8.tar.bz2 dfhack-6ab270d129e098f0200824a798ad2117a6ec33c8.tar.xz | |
Retrieve unit noble position info, and use it in getProfessionName.
Diffstat (limited to 'plugins/lua')
| -rw-r--r-- | plugins/lua/sort/units.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/lua/sort/units.lua b/plugins/lua/sort/units.lua index 7a332d09..35795502 100644 --- a/plugins/lua/sort/units.lua +++ b/plugins/lua/sort/units.lua @@ -52,6 +52,15 @@ local function findRaceCaste(unit) return rraw, safe_index(rraw, 'caste', unit.caste) end +orders.noble = { + key = function(unit) + local info = dfhack.units.getNoblePositions(unit) + if info then + return info[1].position.precedence + end + end +} + orders.profession = { key = function(unit) local cp = dfhack.units.getProfessionName(unit) |
