add an option to disable anonymous armies in combat

This commit is contained in:
Enno Rehling 2010-08-28 23:05:45 -07:00
parent e53c1dc07b
commit bf5bccc133
1 changed files with 7 additions and 1 deletions

View File

@ -3218,10 +3218,16 @@ make_fighter(battle * b, unit * u, side * s1, boolean attack)
const attrib *a = a_find(u->attribs, &at_otherfaction); const attrib *a = a_find(u->attribs, &at_otherfaction);
const faction *stealthfaction = a?get_otherfaction(a):NULL; const faction *stealthfaction = a?get_otherfaction(a):NULL;
unsigned int flags = 0; unsigned int flags = 0;
static int rule_anon_battle = -1;
assert(u->number); 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)) { if (!(AllianceAuto() & HELP_FIGHT) && fval(u, UFL_GROUP)) {
const attrib * agroup = a_find(u->attribs, &at_group); const attrib * agroup = a_find(u->attribs, &at_group);
if (agroup!=NULL) g = (const group*)agroup->data.v; if (agroup!=NULL) g = (const group*)agroup->data.v;