faction stealth is only selectively enabled in E3

This commit is contained in:
Enno Rehling 2012-03-04 19:21:00 -08:00
parent 9640ac19b3
commit 52013f0e7c
2 changed files with 32 additions and 20 deletions

View File

@ -271,32 +271,44 @@ int setstealth_cmd(unit * u, struct order *ord)
case P_FACTION:
/* TARNE PARTEI [NICHT|NUMMER abcd] */
rule = rule_stealth_faction();
if (!rule)
if (!rule) {
/* TARNE PARTEI is disabled */
break;
}
s = getstrtoken();
if (rule&1) {
if (!s || *s == 0) {
fset(u, UFL_ANON_FACTION);
break;
} else if (findparam(s, u->faction->locale) == P_NOT) {
freset(u, UFL_ANON_FACTION);
} else if (findkeyword(s, u->faction->locale) == K_NUMBER) {
break;
}
}
if (rule&2) {
if (findkeyword(s, u->faction->locale) == K_NUMBER) {
const char *s2 = (const char *)getstrtoken();
int nr = -1;
if (s2)
if (s2) {
nr = atoi36(s2);
}
if (!s2 || *s2 == 0 || nr == u->faction->no) {
a_removeall(&u->attribs, &at_otherfaction);
break;
} else {
struct faction *f = findfaction(nr);
if (f == NULL) {
cmistake(u, ord, 66, MSG_EVENT);
break;
} else {
set_factionstealth(u, f);
break;
}
}
}
}
} else {
cmistake(u, ord, 289, MSG_EVENT);
}
break;
case P_ANY:
case P_NOT:

View File

@ -2743,7 +2743,7 @@ int rule_stealth_faction(void)
static int gamecookie = -1;
static int rule = -1;
if (rule < 0 || gamecookie != global.cookie) {
rule = get_param_int(global.parameters, "rules.stealth.faction", 1);
rule = get_param_int(global.parameters, "rules.stealth.faction", 0xFF);
gamecookie = global.cookie;
assert(rule >= 0);
}