diff --git a/src/attributes/attributes.c b/src/attributes/attributes.c index 54da3c6fd..f1b97d8a5 100644 --- a/src/attributes/attributes.c +++ b/src/attributes/attributes.c @@ -61,7 +61,7 @@ static int obs_age(struct attrib *a, void *owner) UNUSED_ARG(owner); update_interval(od->f, (region *)owner); - return --od->timer; + return --od->timer > 0; } static void obs_write(const variant *var, const void *owner, @@ -90,13 +90,13 @@ attrib_type at_observer = { "observer", obs_init, a_free_voidptr, obs_age, obs_write, obs_read }; -static attrib *make_observer(faction *f, int perception) +static attrib *make_observer(faction *f, int perception, int timer) { attrib * a = a_new(&at_observer); obs_data *od = (obs_data *)a->data.v; od->f = f; od->skill = perception; - od->timer = 2; + od->timer = timer; return a; } @@ -132,7 +132,7 @@ void set_observer(region *r, faction *f, int skill, int turns) else { fset(r, RF_OBSERVER); } - a_add(&r->attribs, make_observer(f, skill)); + a_add(&r->attribs, make_observer(f, skill, turns)); } attrib_type at_unitdissolve = { diff --git a/src/reports.c b/src/reports.c index 395c2e6cc..5f8990c03 100644 --- a/src/reports.c +++ b/src/reports.c @@ -1000,7 +1000,6 @@ int stealth_modifier(const region *r, const faction *f, seen_mode mode) case seen_unit: return 0; case seen_lighthouse: - return -2; case seen_travel: return -1; default: diff --git a/src/spells.test.c b/src/spells.test.c index d1000c091..1fb75ecd5 100644 --- a/src/spells.test.c +++ b/src/spells.test.c @@ -164,7 +164,7 @@ static void test_view_reality(CuTest *tc) { CuAssertIntEquals(tc, -1, get_observer(rx, f)); free_castorder(&co); - set_observer(r, f, -1, -1); + set_observer(r, f, -1, 0); CuAssertIntEquals(tc, -1, get_observer(r, f)); /* target region r exists, but astral space is blocked */