From 74cce04268a77de428c55152ba50358826353cd1 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 15 Dec 2001 15:55:31 +0000 Subject: [PATCH] weltkarte --- src/mapper/mapper.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/mapper/mapper.c b/src/mapper/mapper.c index 430523178..6ca8870d5 100644 --- a/src/mapper/mapper.c +++ b/src/mapper/mapper.c @@ -280,6 +280,21 @@ has_laen(region *r) { } #endif +static int +crwritemap(void) +{ + FILE * F = fopen("world.cr", "w+"); + region * r; + for (r=regions;r;r=r->next) { + plane * p = rplane(r); + fprintf(F, "REGION %d %d %d\n", r->x, r->y, p?p->id:0); + fprintf(F, "\"%s\";Name\n\"%s\";Terrain\n", rname(r, default_locale), LOC(default_locale, terrain[rterrain(r)].name)); + } + fclose(F); + return 0; +} + + void drawmap(boolean maponly) { int x, x1, y1, y2, s, q; @@ -715,6 +730,9 @@ movearound(int rx, int ry) { DisplayRegList(1); ch = 999999; break; + case 'W': + crwritemap(); + break; case 'q': if (yes_no(0, "Wirklich beenden?", 'n')) return;