get_normalplane is unnecessary

This commit is contained in:
Enno Rehling 2016-01-28 12:46:38 +01:00
parent 91f894b290
commit 69d2c7c9b3
3 changed files with 7 additions and 13 deletions

View File

@ -3146,7 +3146,7 @@ static int sp_chaossuction(castorder * co)
unit *mage = co->magician.u; unit *mage = co->magician.u;
int cast_level = co->level; int cast_level = co->level;
if (getplane(r) != get_normalplane()) { if (rplane(r)) {
/* Der Zauber funktioniert nur in der materiellen Welt. */ /* Der Zauber funktioniert nur in der materiellen Welt. */
cmistake(mage, co->order, 190, MSG_MAGIC); cmistake(mage, co->order, 190, MSG_MAGIC);
return 0; return 0;
@ -5436,8 +5436,9 @@ int sp_fetchastral(castorder * co)
region *rt = co_get_region(co); /* region to which we are fetching */ region *rt = co_get_region(co); /* region to which we are fetching */
region *ro = NULL; /* region in which the target is */ region *ro = NULL; /* region in which the target is */
if (rplane(rt) != get_normalplane()) { if (rplane(rt)) {
ADDMSG(&mage->faction->msgs, msg_feedback(mage, co->order, "error190", "")); /* Der Zauber funktioniert nur in der materiellen Welt. */
cmistake(mage, co->order, 190, MSG_MAGIC);
return 0; return 0;
} }

View File

@ -96,8 +96,7 @@ region_list *astralregions(const region * r, bool(*valid) (const region *))
region *r_standard_to_astral(const region * r) region *r_standard_to_astral(const region * r)
{ {
if (rplane(r) != get_normalplane()) assert(!rplane(r));
return NULL;
return tpregion(r); return tpregion(r);
} }
@ -109,9 +108,9 @@ region *r_astral_to_standard(const region * r)
assert(is_astral(r)); assert(is_astral(r));
x = (r->x - TE_CENTER_X) * TP_DISTANCE; x = (r->x - TE_CENTER_X) * TP_DISTANCE;
y = (r->y - TE_CENTER_Y) * TP_DISTANCE; y = (r->y - TE_CENTER_Y) * TP_DISTANCE;
pnormalize(&x, &y, get_normalplane()); pnormalize(&x, &y, NULL);
r2 = findregion(x, y); r2 = findregion(x, y);
if (r2 == NULL || rplane(r2) != get_normalplane()) if (r2 == NULL || rplane(r2))
return NULL; return NULL;
return r2; return r2;
@ -168,11 +167,6 @@ void spawn_braineaters(float chance)
} }
} }
plane *get_normalplane(void)
{
return NULL;
}
bool is_astral(const region * r) bool is_astral(const region * r)
{ {
plane *pl = get_astralplane(); plane *pl = get_astralplane();

View File

@ -31,7 +31,6 @@ extern "C" {
extern bool inhabitable(const struct region *r); extern bool inhabitable(const struct region *r);
extern bool is_astral(const struct region *r); extern bool is_astral(const struct region *r);
extern struct plane *get_astralplane(void); extern struct plane *get_astralplane(void);
extern struct plane *get_normalplane(void);
void create_teleport_plane(void); void create_teleport_plane(void);
void set_teleport_plane_regiontypes(void); void set_teleport_plane_regiontypes(void);