From 6075396de3248e1a5ae51e2c7ebda54f4093d6ca Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 29 Oct 2016 14:16:40 +0200 Subject: [PATCH] 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? --- src/move.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/move.c b/src/move.c index 96a999f0d..f227118bb 100644 --- a/src/move.c +++ b/src/move.c @@ -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)