http://eressea.upb.de/mantis/view.php?id=925
Ring of invisibility wearer indirectly visible

Problem was that there was a check for general stealth that was done first,
and rings were skipped if it failed. Fixed.
This commit is contained in:
Enno Rehling 2006-06-06 20:01:21 +00:00
parent 9bd06d5b60
commit 0b891b5a00
1 changed files with 11 additions and 12 deletions

View File

@ -1106,26 +1106,28 @@ cansee_durchgezogen(const faction * f, const region * r, const unit * u, int mod
* erblickt wird */ * erblickt wird */
{ {
int n; int n;
boolean cansee = false;
unit *u2; unit *u2;
if (u->race == new_race[RC_SPELL] || u->number == 0) return false; if (u->race == new_race[RC_SPELL] || u->number == 0) return false;
else if (u->faction == f) cansee = true; else if (u->faction == f) return true;
else { else {
int rings;
if (getguard(u) || usiege(u) || u->building || u->ship) { if (getguard(u) || usiege(u) || u->building || u->ship) {
cansee = true; return true;
} }
n = eff_stealth(u, r) - modifier; n = eff_stealth(u, r) - modifier;
if (n<=0) { rings = invisible(u, NULL);
cansee = true; if (rings==0 && n<=0) {
return true;
} }
for (u2 = r->units; !cansee && u2; u2 = u2->next){ for (u2 = r->units; u2; u2 = u2->next){
if (u2->faction == f) { if (u2->faction == f) {
int o; int o;
if (invisible(u, u2) >= u->number) continue; if (rings && invisible(u, u2) >= u->number) continue;
o = eff_skill(u2, SK_OBSERVATION, r); o = eff_skill(u2, SK_OBSERVATION, r);
@ -1134,15 +1136,12 @@ cansee_durchgezogen(const faction * f, const region * r, const unit * u, int mod
o = NIGHT_EYE_TALENT; o = NIGHT_EYE_TALENT;
#endif #endif
if (o >= n) { if (o >= n) {
cansee = true; return true;
} }
} }
} }
if (getguard(u) || usiege(u) || u->building || u->ship) {
cansee = true;
} }
} return false;
return cansee;
} }
#ifndef NDEBUG #ifndef NDEBUG