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

View file

@ -2743,7 +2743,7 @@ int rule_stealth_faction(void)
static int gamecookie = -1; static int gamecookie = -1;
static int rule = -1; static int rule = -1;
if (rule < 0 || gamecookie != global.cookie) { 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; gamecookie = global.cookie;
assert(rule >= 0); assert(rule >= 0);
} }