From ab2b357f8cd34409db3e197b77836f02cd0144ea Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 8 Jul 2009 20:42:17 +0000 Subject: [PATCH] - fixing round world info leak --- src/common/gamecode/creport.c | 6 ++++++ src/common/gamecode/report.c | 2 ++ src/common/kernel/region.c | 2 ++ src/common/kernel/reports.c | 1 + 4 files changed, 11 insertions(+) diff --git a/src/common/gamecode/creport.c b/src/common/gamecode/creport.c index fcfcc8f77..c9286d260 100644 --- a/src/common/gamecode/creport.c +++ b/src/common/gamecode/creport.c @@ -311,6 +311,7 @@ cr_region(variant var, char * buffer, const void * userdata) if (r) { plane * pl = rplane(r); int nx = region_x(r, report), ny = region_y(r, report); + pnormalize(&nx, &ny, pl); sprintf(buffer, "%d %d %d", nx, ny, plane_id(pl)); return 0; } @@ -425,6 +426,7 @@ cr_regions(variant var, char * buffer, const void * userdata) char * wp = buffer; int nx = region_x(r, f), ny = region_y(r, f); + pnormalize(&nx, &ny, pl); wp += sprintf(wp, "\"%d %d %d", nx, ny, z); for (i=1;i!=rdata->nregions;++i) { r = rdata->regions[i]; @@ -1107,6 +1109,7 @@ cr_output_region(FILE * F, report_context * ctx, seen_region * sr) } else { nx = region_x(r, f); ny = region_y(r, f); + pnormalize(&nx, &ny, pl); } if (plid==0) { @@ -1221,6 +1224,7 @@ cr_output_region(FILE * F, report_context * ctx, seen_region * sr) while(rl2) { region * r = rl2->data; int nx = region_x(r, f), ny = region_y(r, f); + pnormalize(&nx, &ny, pl); fprintf(F, "SCHEMEN %d %d\n", nx, ny); fprintf(F, "\"%s\";Name\n", rname(r, f->locale)); rl2 = rl2->next; @@ -1417,6 +1421,8 @@ report_computer(const char * filename, report_context * ctx, const char * charse plane * pl = rplane(bm->r); int plid = plane_id(pl); int nx = region_x(bm->r, f), ny = region_y(bm->r, f); + + pnormalize(&nx, &ny, pl); if (!plid) fprintf(F, "BATTLE %d %d\n", nx, ny); else { fprintf(F, "BATTLE %d %d %d\n", nx, ny, plid); diff --git a/src/common/gamecode/report.c b/src/common/gamecode/report.c index 6059cd431..950482fbc 100644 --- a/src/common/gamecode/report.c +++ b/src/common/gamecode/report.c @@ -1396,6 +1396,8 @@ report_template(const char * filename, report_context * ctx, const char * charse if (!dh) { plane * pl = getplane(r); int nx = region_x(r, f), ny = region_y(r, f); + + pnormalize(&nx, &ny, pl); rps_nowrap(F, ""); rnl(F); if (pl && pl->id != 0) { diff --git a/src/common/kernel/region.c b/src/common/kernel/region.c index ceb080cb8..fc3e04cd6 100644 --- a/src/common/kernel/region.c +++ b/src/common/kernel/region.c @@ -118,7 +118,9 @@ write_regionname(const region * r, const faction * f, char * buffer, size_t size if (r==NULL) { strcpy(buf, "(null)"); } else { + plane * pl = rplane(r); int nx = region_x(r, f), ny = region_y(r, f); + pnormalize(&nx, &ny, pl); snprintf(buf, size, "%s (%d,%d)", rname(r, lang), nx, ny); } buf[size-1] = 0; diff --git a/src/common/kernel/reports.c b/src/common/kernel/reports.c index 1eae94fd8..8bc4e8bd4 100644 --- a/src/common/kernel/reports.c +++ b/src/common/kernel/reports.c @@ -1630,6 +1630,7 @@ f_regionid(const region * r, const faction * f, char * buffer, size_t size) plane * pl = rplane(r); const char * name = pl?pl->name:0; int nx = region_x(r, f), ny = region_y(r, f); + pnormalize(&nx, &ny, pl); strncpy(buffer, rname(r, f->locale), size); buffer[size-1]=0; sprintf(buffer+strlen(buffer), " (%d,%d%s%s)", nx, ny, name?",":"", (name)?name:"");