Skip to content

Commit

Permalink
Merge pull request #5076 from dhthwy/dangertweak
Browse files Browse the repository at this point in the history
isDanger(): don't mark visitors hostile
  • Loading branch information
myk002 authored Dec 7, 2024
2 parents a7a1d50 + 269284f commit a08dc4b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions library/modules/Units.cpp
Original file line number Diff line number Diff line change
@@ -642,13 +642,14 @@ bool Units::isDanger(df::unit *unit) {
if (isTame(unit) || isOwnGroup(unit))
return false;

// NOTE: demons from hell have visitor/visitor_unvited set to false
// other demons may visit as a diplomat
return isCrazed(unit)
|| isInvader(unit)
|| isOpposedToLife(unit)
|| isAgitated(unit)
|| isSemiMegabeast(unit)
|| isNightCreature(unit)
|| isGreatDanger(unit);
|| unit->flags2.bits.visitor_uninvited
|| ((isGreatDanger(unit) || isNightCreature(unit)) && !unit->flags2.bits.visitor);
}

bool Units::isGreatDanger(df::unit *unit) {

0 comments on commit a08dc4b

Please sign in to comment.