Skip to content

Commit

Permalink
Merge pull request #5219 from myk002/myk_its_automatic
Browse files Browse the repository at this point in the history
expose Units::setAutomaticProfessions to Lua
  • Loading branch information
myk002 authored Jan 25, 2025
2 parents 45eb0c9 + 8e276c7 commit de40c95
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Template for new versions:
## API

## Lua
- ``dfhack.units.setAutomaticProfessions``: sets unit labors according to current work detail settings

## Removed

Expand Down
4 changes: 4 additions & 0 deletions docs/dev/Lua API.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1817,6 +1817,10 @@ Units module
in the in-game labor management screens (including DFHack's `labor
manipulator screen <manipulator>`).

* ``dfhack.units.setAutomaticProfessions(unit)``

Set appropriate labors on a unit based on current work detail settings.

* ``dfhack.units.computeMovementSpeed(unit)``

Computes number of frames * 100 it takes the unit to move in its current
Expand Down
1 change: 1 addition & 0 deletions library/LuaApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2094,6 +2094,7 @@ static const LuaWrapper::FunctionReg dfhack_units_module[] = {
WRAPM(Units, getExperience),
WRAPM(Units, isValidLabor),
WRAPM(Units, setLaborValidity),
WRAPM(Units, setAutomaticProfessions),
WRAPM(Units, computeMovementSpeed),
WRAPM(Units, computeSlowdownFactor),
WRAPM(Units, getProfession),
Expand Down

0 comments on commit de40c95

Please sign in to comment.