Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rejuvenate] update portrait, sprite, and labors when converting to adult #1417

Merged
merged 1 commit into from
Mar 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions rejuvenate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down