Skip to content

Commit 0471d9e

Browse files
committed
use library function for getting the caste raw
1 parent a6cdf8c commit 0471d9e

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

rejuvenate.lua

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,9 @@ local DEFAULT_OLD_AGE = 160
77
local ANY_BABY = df.global.world.units.other.ANY_BABY
88

99
local function get_caste_misc(unit)
10-
local cre = df.creature_raw.find(unit.race)
11-
if not cre then return end
12-
if unit.caste < 0 or unit.caste >= #cre.caste then
13-
return
14-
end
15-
return cre.caste[unit.caste].misc
10+
local craw = dfhack.units.getCasteRaw(unit)
11+
if not craw then return end
12+
return craw.misc
1613
end
1714

1815
local function get_adult_age(misc)

0 commit comments

Comments
 (0)