fixing "regions" message in CR.

This commit is contained in:
Enno Rehling 2007-12-13 09:32:51 +00:00
parent 5090303bbe
commit bda9885774
2 changed files with 28 additions and 26 deletions

View File

@ -429,16 +429,18 @@ cr_resources(variant var, char * buffer, const void * userdata)
static int
cr_regions(variant var, char * buffer, const void * userdata)
{
faction * f = (faction*)userdata;
const arg_regions * rdata = (const arg_regions *)var.v;
char * wp = buffer;
if (rdata!=NULL && rdata->nregions>0) {
region * r = rdata->regions[0];
int i, z = r->planep?r->planep->id:0;
wp += sprintf(wp, "\"%d %d %d", r->x, r->y, z);
wp += sprintf(wp, "\"%d %d %d", region_x(r, f), region_y(r, f), z);
for (i=1;i!=rdata->nregions;++i) {
r = rdata->regions[i];
z = r->planep?r->planep->id:0;
wp += sprintf(wp, ", %d %d %d", r->x, r->y, z);
wp += sprintf(wp, ", %d %d %d", region_x(r, f), region_y(r, f), z);
}
strcat(wp, "\"");
}

View File

@ -441,7 +441,7 @@ b_nameroad(const border * b, const region * r, const struct faction * f, int gfl
} else {
int percent = max(1, 100*local/r->terrain->max_road);
if (local) {
sprintf(buffer, LOC(f->locale, "nr_road_percent"), percent);
snprintf(buffer, sizeof(buffer), LOC(f->locale, "nr_road_percent"), percent);
} else {
return LOC(f->locale, "nr_a_road_connection");
}