From c53ac9d8aab7bcdd265bdc0ac4ef603cb1ad50fd Mon Sep 17 00:00:00 2001
From: Enno Rehling <enno@eressea.de>
Date: Sat, 1 Oct 2016 21:03:16 +0200
Subject: [PATCH] remove RS_FARVISION, it is the only spell that uses units.

---
 src/kernel/unit.c |  1 -
 src/magic.h       |  6 ------
 src/reports.c     | 19 ++-----------------
 src/spells.c      |  6 +++---
 4 files changed, 5 insertions(+), 27 deletions(-)

diff --git a/src/kernel/unit.c b/src/kernel/unit.c
index c5172cafc..ab3bd294c 100644
--- a/src/kernel/unit.c
+++ b/src/kernel/unit.c
@@ -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);
diff --git a/src/magic.h b/src/magic.h
index 257ba11c4..59ef92475 100644
--- a/src/magic.h
+++ b/src/magic.h
@@ -184,12 +184,6 @@ extern "C" {
         SPC_LINEAR                  /* Komponenten pro Level und m�ssen vorhanden sein */
     };
 
-    enum {
-        RS_DUMMY,
-        RS_FARVISION,
-        MAX_REGIONSPELLS
-    };
-
     /* ------------------------------------------------------------- */
     /* Prototypen */
 
diff --git a/src/reports.c b/src/reports.c
index ff076a866..dc0edf1b3 100644
--- a/src/reports.c
+++ b/src/reports.c
@@ -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! */
diff --git a/src/spells.c b/src/spells.c
index 4f2d49d9d..7d300c5e1 100644
--- a/src/spells.c
+++ b/src/spells.c
@@ -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;