From c377890be62c944d5217422fc7930536268aa8d6 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Fri, 7 Mar 2025 17:11:47 -0800 Subject: [PATCH] update portrait, sprite, and labors when converting to adult --- changelog.txt | 2 ++ rejuvenate.lua | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/changelog.txt b/changelog.txt index 0b46206fd2..0d42ca183c 100644 --- a/changelog.txt +++ b/changelog.txt @@ -48,6 +48,8 @@ Template for new versions: - `hfs-pit`: use correct wall types when making pits with walls - `gui/liquids`: using the remove tool with magma selected will no longer create unexpected unpathable tiles - `idle-crafting`: do not assign crafting jobs to nobles holding meetings (avoid dangling jobs) +- `rejuvenate`: update unit portrait and sprite when aging up babies and children +- `rejuvenate`: recalculate labor assignments for unit when aging up babies and children (so they can start accepting jobs) ## Misc Improvements - `hide-tutorials`: handle tutorial popups for adventure mode diff --git a/rejuvenate.lua b/rejuvenate.lua index a2e36c86e2..ac0cf84f48 100644 --- a/rejuvenate.lua +++ b/rejuvenate.lua @@ -71,6 +71,11 @@ function rejuvenate(unit, quiet, force, dry_run, age) unit.profession2 = df.profession.STANDARD if hf then hf.profession = df.profession.STANDARD end end + unit.flags4.portrait_must_be_refreshed = true + unit.flags4.any_texture_must_be_refreshed = true + if dfhack.world.isFortressMode() then + dfhack.units.setAutomaticProfessions(unit) + end if not quiet then print(name .. ' is now ' .. age .. ' years old and will live a normal lifespan henceforth') end