From 2ef753bd161ab9b080e7b278c104e133594d40a2 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Tue, 24 Sep 2019 21:42:53 +0200 Subject: [PATCH] Tod den region_list Listen. Weg mit astralregions(). --- src/teleport.c | 31 ------------------------------- src/teleport.h | 2 -- 2 files changed, 33 deletions(-) diff --git a/src/teleport.c b/src/teleport.c index 6a897e057..590c458be 100644 --- a/src/teleport.c +++ b/src/teleport.c @@ -43,37 +43,6 @@ static region *tpregion(const region * r) return rt; } -region_list *astralregions(const region * r, bool(*valid) (const region *)) -{ - region_list *rlist = NULL; - int x, y; - - assert(is_astral(r)); - if (!is_astral(r)) { - log_error("astralregions was called with a non-astral region.\n"); - return NULL; - } - r = r_astral_to_standard(r); - if (r == NULL) - return NULL; - - for (x = -TP_RADIUS; x <= +TP_RADIUS; ++x) { - for (y = -TP_RADIUS; y <= +TP_RADIUS; ++y) { - region *rn; - int dist = koor_distance(0, 0, x, y); - int nx = r->x + x, ny = r->y + y; - - if (dist > TP_RADIUS) - continue; - pnormalize(&nx, &ny, rplane(r)); - rn = findregion(nx, ny); - if (rn != NULL && (valid == NULL || valid(rn))) - add_regionlist(&rlist, rn); - } - } - return rlist; -} - int get_astralregions(const region * r, bool(*valid) (const region *), region *result[]) { diff --git a/src/teleport.h b/src/teleport.h index ce46a5778..72815f497 100644 --- a/src/teleport.h +++ b/src/teleport.h @@ -16,8 +16,6 @@ extern "C" { struct region *r_standard_to_astral(const struct region *r); struct region *r_astral_to_standard(const struct region *); - struct region_list *astralregions(const struct region *rastral, - bool(*valid) (const struct region *)); struct region_list *all_in_range(const struct region *r, int n, bool(*valid) (const struct region *)); bool inhabitable(const struct region *r);