Skip to content

Commit

Permalink
Merge pull request #4180 from myk002/myk_agitated
Browse files Browse the repository at this point in the history
[Units] agitated wildlife is dangerous
  • Loading branch information
myk002 authored Jan 16, 2024
2 parents 66d05c2 + 1065aa3 commit 0152bc7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ Template for new versions:
- Plugin ABI (binary interface) version bump! Any external plugins must be recompiled against this version of DFHack source code in order to load.
- ``Persistence``: persistent keys are now namespaced by an entity_id (e.g. a player fort site ID)
- ``Persistence``: data is now stored one file per entity ID (plus one for the global world) in the DF savegame directory
- ``Units.isDanger``: now returns true for agitated wildlife

## Lua
- ``dfhack.capitalizeStringWords``: new function, returns string with all words capitalized
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/Lua API.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1445,7 +1445,7 @@ Units module

The unit is dangerous, and probably hostile. This includes
Great Dangers (see below), semi-megabeasts, night creatures,
undead, invaders, and crazed units.
undead, invaders, agitated wildlife, and crazed units.

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

Expand Down
1 change: 1 addition & 0 deletions library/modules/Units.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,7 @@ bool Units::isDanger(df::unit* unit) {
return isCrazed(unit) ||
isInvader(unit) ||
isUndead(unit, true) ||
unit->flags4.bits.agitated_wilderness_creature ||
isSemiMegabeast(unit) ||
isNightCreature(unit) ||
isGreatDanger(unit);
Expand Down

0 comments on commit 0152bc7

Please sign in to comment.