remove RS_FARVISION, it is the only spell that uses units.

This commit is contained in:
Enno Rehling 2016-10-01 21:03:16 +02:00
parent 530e47efae
commit c53ac9d8aa
4 changed files with 5 additions and 27 deletions

View file

@ -1172,7 +1172,6 @@ void u_setfaction(unit * u, faction * f)
}
}
/* vorsicht Sprueche koennen u->number == RS_FARVISION haben! */
void set_number(unit * u, int count)
{
assert(count >= 0);

View file

@ -184,12 +184,6 @@ extern "C" {
SPC_LINEAR /* Komponenten pro Level und müssen vorhanden sein */
};
enum {
RS_DUMMY,
RS_FARVISION,
MAX_REGIONSPELLS
};
/* ------------------------------------------------------------- */
/* Prototypen */

View file

@ -1308,17 +1308,6 @@ static void cb_add_seen(region *r, unit *u, void *cbdata) {
}
}
static bool unit_cansee(const unit *u)
{
const race *rc = u_race(u);
static const race *rc_spell;
static int rc_cache;
if (rc_changed(&rc_cache)) {
rc_spell = get_race(RC_SPELL);
}
return (rc!=rc_spell || u->number == RS_FARVISION);
}
/** set region.seen based on visibility by one faction.
*
* this function may also update ctx->last and ctx->first for potential
@ -1355,9 +1344,7 @@ void prepare_report(report_context *ctx, faction *f)
u = building_owner(b);
if (u && u->faction==f) {
prepare_lighthouse(b, ctx);
if (unit_cansee(u)) {
add_seen_nb(f, r, seen_unit);
}
add_seen_nb(f, r, seen_unit);
}
}
}
@ -1366,9 +1353,7 @@ void prepare_report(report_context *ctx, faction *f)
}
for (u = r->units; u; u = u->next) {
if (u->faction==f) {
if (unit_cansee(u)) {
add_seen_nb(f, r, seen_unit);
}
add_seen_nb(f, r, seen_unit);
if (fval(r, RF_LIGHTHOUSE)) {
if (u->building && u->building->type == bt_lighthouse && inside_building(u)) {
/* we are in a lighthouse. add the regions we can see from here! */

View file

@ -4168,7 +4168,7 @@ static int sp_pump(castorder * co)
}
u =
create_unit(rt, mage->faction, RS_FARVISION, get_race(RC_SPELL), 0,
create_unit(rt, mage->faction, 1, get_race(RC_SPELL), 0,
"spell/pump", NULL);
u->age = 2;
set_level(u, SK_PERCEPTION, effskill(target, SK_PERCEPTION, 0));
@ -4812,7 +4812,7 @@ int sp_dreamreading(castorder * co)
}
u2 =
create_unit(u->region, mage->faction, RS_FARVISION, get_race(RC_SPELL), 0,
create_unit(u->region, mage->faction, 1, get_race(RC_SPELL), 0,
"spell/dreamreading", NULL);
set_number(u2, 1);
u2->age = 2; /* Nur fuer diese Runde. */
@ -5691,7 +5691,7 @@ int sp_viewreality(castorder * co)
region *rt = rl2->data;
if (!is_cursed(rt->attribs, C_ASTRALBLOCK, 0)) {
u =
create_unit(rt, mage->faction, RS_FARVISION, get_race(RC_SPELL), 0,
create_unit(rt, mage->faction, 1, get_race(RC_SPELL), 0,
"spell/viewreality", NULL);
set_level(u, SK_PERCEPTION, co->level / 2);
u->age = 2;