From bf5bccc133f711c06a218c7ae2ae56f589b5f91e Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 28 Aug 2010 23:05:45 -0700 Subject: [PATCH] add an option to disable anonymous armies in combat --- src/kernel/battle.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/kernel/battle.c b/src/kernel/battle.c index 74b60bc4f..e3e84441e 100644 --- a/src/kernel/battle.c +++ b/src/kernel/battle.c @@ -3218,10 +3218,16 @@ make_fighter(battle * b, unit * u, side * s1, boolean attack) const attrib *a = a_find(u->attribs, &at_otherfaction); const faction *stealthfaction = a?get_otherfaction(a):NULL; unsigned int flags = 0; + static int rule_anon_battle = -1; assert(u->number); - if (fval(u, UFL_ANON_FACTION)!=0) flags |= SIDE_STEALTH; + if (rule_anon_battle<0) { + rule_anon_battle = get_param_int(global.parameters, "rules.stealth.anon_battle", 1); + } + if (rule_anon_battle) { + if (fval(u, UFL_ANON_FACTION)!=0) flags |= SIDE_STEALTH; + } if (!(AllianceAuto() & HELP_FIGHT) && fval(u, UFL_GROUP)) { const attrib * agroup = a_find(u->attribs, &at_group); if (agroup!=NULL) g = (const group*)agroup->data.v;