From ab43bf92e2f2d3cd155ceb4db4d24da29cc8a044 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Tue, 12 Mar 2002 22:40:23 +0000 Subject: [PATCH] =?UTF-8?q?Regatta-Queste=20verg=C3=B6=C3=9Fert.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/eressea/korrektur.c | 55 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 50 insertions(+), 5 deletions(-) diff --git a/src/eressea/korrektur.c b/src/eressea/korrektur.c index 14b6377d5..e19a3163b 100644 --- a/src/eressea/korrektur.c +++ b/src/eressea/korrektur.c @@ -1763,13 +1763,58 @@ fix_timeouts(void) #include +static int +resize_plane(struct plane * p, int radius) +{ + region * center = findregion(p->minx+(p->maxx-p->minx)/2, p->miny+(p->maxy-p->miny)/2); + int minx = center->x - radius; + int maxx = center->x + radius; + int miny = center->y - radius; + int maxy = center->y + radius; + int x, y; + + for (x=minx;x<=maxx;++x) { + for (y=miny;y<=maxy;++y) { + region * r = findregion(x, y); + if (r && rplane(r)!=p) break; + } + } + if (x<=maxx) return -1; + p->maxx=maxx; + p->maxy=maxy; + p->minx=minx; + p->miny=miny; + for (x=minx;x<=maxx;++x) { + for (y=miny;y<=maxy;++y) { + region * r = findregion(x, y); + if (r==NULL) { + r = new_region(minx+x, miny+y); + freset(r, RF_ENCOUNTER); + r->planep = p; + if (distance(r, center)==radius) { + terraform(r, T_FIREWALL); + } else if (distance(r, center)minx+(p->maxx-p->minx)/2, p->miny+(p->maxy-p->miny)/2); - gm_addfaction("gregorjochmann@gmx.de", p, center); - return 0; + plane * p = getplanebyname("Regatta"); + if (p) { + return resize_plane(p, 40); + } else { + region * center; + p = gm_addplane(40, PFL_NORECRUITS, "Regatta"); + center = findregion(p->minx+(p->maxx-p->minx)/2, p->miny+(p->maxy-p->miny)/2); + gm_addfaction("gregorjochmann@gmx.de", p, center); + return 0; + } } static int @@ -1812,7 +1857,7 @@ update_gmquests(void) } do_once("et02", secondfaction(f)); } - do_once("rq01", regatta_quest()); + do_once("rq02", regatta_quest()); } #if 0