From ec0fa86e269d1d162a03ce08eb4601d5bd9b71d5 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Tue, 25 May 2004 09:30:39 +0000 Subject: [PATCH] http://eressea.upb.de/mantis/bug_view_page.php?bug_id=0000023 - noch ein bug, ein != statt einem == --- src/common/kernel/teleport.c | 12 ++++++++++-- src/common/kernel/teleport.h | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/common/kernel/teleport.c b/src/common/kernel/teleport.c index ceb092a02..6d46df235 100644 --- a/src/common/kernel/teleport.c +++ b/src/common/kernel/teleport.c @@ -94,8 +94,10 @@ region * r_standard_to_astral(const region *r) { region *r2; - r2 = tpregion(r); + assert(rplane(r) == get_normalplane()); + + r2 = tpregion(r); if (rplane(r2) != get_astralplane() || rterrain(r2) != T_ASTRAL) return NULL; return r2; @@ -112,7 +114,7 @@ r_astral_to_standard(const region *r) y = (r->y-TE_CENTER_Y)*TP_RADIUS; r2 = findregion(x,y); - if (r2!=NULL || getplaneid(r2) != 0) return NULL; + if (rplane(r2)!=get_normalplane()) return NULL; return r2; } @@ -162,6 +164,12 @@ random_in_teleport_plane(void) } } +plane * +get_normalplane(void) +{ + return NULL; +} + plane * get_astralplane(void) { diff --git a/src/common/kernel/teleport.h b/src/common/kernel/teleport.h index 312cfefa3..8b8db74a4 100644 --- a/src/common/kernel/teleport.h +++ b/src/common/kernel/teleport.h @@ -24,6 +24,7 @@ extern "C" { extern struct region_list *all_in_range(const struct region *r, int n, boolean (*valid)(const struct region *)); extern boolean inhabitable(const struct region * r); extern struct plane * get_astralplane(void); + extern struct plane * get_normalplane(void); void create_teleport_plane(void); void set_teleport_plane_regiontypes(void);