WIP: make guard tests pass.

BUG: monsters are always allowed to guard unarmed.
TODO: more code duplication, refactor it.
TODO: ents do not guard resources?
This commit is contained in:
Enno Rehling 2016-10-29 14:16:40 +02:00
parent f1d07fb647
commit 6075396de3
1 changed files with 1 additions and 1 deletions

View File

@ -1015,7 +1015,7 @@ static bool is_guardian_r(const unit * guard)
if ((guard->flags & UFL_GUARD) == 0)
return false;
return armedmen(guard, true) > 0 || fval(u_race(guard), RCF_UNARMEDGUARD);
return fval(u_race(guard), RCF_UNARMEDGUARD) || is_monsters(guard->faction) || (armedmen(guard, true) > 0);
}
bool is_guard(const struct unit * u, unsigned int mask)