Merge remote-tracking branch 'suokko/missing_isDiplomat_1324' into develop

develop
lethosor 2018-06-29 22:19:12 -04:00
commit f8250bd8a4
4 changed files with 16 additions and 0 deletions

@ -37,6 +37,13 @@ changelog.txt uses a syntax similar to RST, with a few special sequences:
================================================================================
# Future
## Fixes
- `fix/dead-units`: fixed script trying to use missing isDiplomat function
## API
- New functions:
- ``Units::isDiplomat(unit)``
# 0.44.11-alpha1
## Structures

@ -1626,6 +1626,7 @@ static const LuaWrapper::FunctionReg dfhack_units_module[] = {
WRAPM(Units, isMale),
WRAPM(Units, isFemale),
WRAPM(Units, isMerchant),
WRAPM(Units, isDiplomat),
WRAPM(Units, isForest),
WRAPM(Units, isMarkedForSlaughter),
WRAPM(Units, isTame),

@ -139,6 +139,7 @@ DFHACK_EXPORT bool isTamable(df::unit* unit);
DFHACK_EXPORT bool isMale(df::unit* unit);
DFHACK_EXPORT bool isFemale(df::unit* unit);
DFHACK_EXPORT bool isMerchant(df::unit* unit);
DFHACK_EXPORT bool isDiplomat(df::unit* unit);
DFHACK_EXPORT bool isForest(df::unit* unit);
DFHACK_EXPORT bool isMarkedForSlaughter(df::unit* unit);
DFHACK_EXPORT bool isTame(df::unit* unit);

@ -1476,6 +1476,13 @@ bool Units::isMerchant(df::unit* unit)
return unit->flags1.bits.merchant == 1;
}
bool Units::isDiplomat(df::unit* unit)
{
CHECK_NULL_POINTER(unit);
return unit->flags1.bits.diplomat == 1;
}
bool Units::isForest(df::unit* unit)
{
CHECK_NULL_POINTER(unit);