- error handling missing terrains

- bugfix terrain-xml
This commit is contained in:
Enno Rehling 2005-12-31 13:45:10 +00:00
parent e30c171995
commit 80186ba627
3 changed files with 18 additions and 14 deletions

View File

@ -720,8 +720,8 @@ create_backup(char *file)
{
#ifdef HAVE_UNISTD_H
char bfile[MAX_PATH];
char command[MAX_PATH*2+10];
int c = 1;
do {
sprintf(bfile, "%s.backup%d", file, c);
c++;
@ -1301,22 +1301,26 @@ readregion(FILE * F, short x, short y)
char name[64];
rs(F, name);
terrain = get_terrain(name);
if (terrain==NULL) {
log_error(("Unknown terrain '%s'\n", name));
assert(!"unknown terrain");
}
}
r->terrain = terrain;
r->flags = (char) ri(F);
r->terrain = terrain;
r->flags = (char) ri(F);
if (global.data_version >= REGIONAGE_VERSION)
r->age = (unsigned short) ri(F);
else
r->age = 0;
if (global.data_version >= REGIONAGE_VERSION)
r->age = (unsigned short) ri(F);
else
r->age = 0;
if (fval(r->terrain, LAND_REGION)) {
r->land = calloc(1, sizeof(land_region));
rds(F, &r->land->name);
if (fval(r->terrain, LAND_REGION)) {
r->land = calloc(1, sizeof(land_region));
rds(F, &r->land->name);
#ifndef NDEBUG
if (strlen(r->land->name)>=NAMESIZE) r->land->name[NAMESIZE] = 0;
#endif
}
}
if (r->land) {
int i;
if(global.data_version < GROWTREE_VERSION) {

View File

@ -18,7 +18,7 @@
</text>
<text locale="de">
Dieses Abzeichen identifiziert die Partei seines Träger offiziell
als einen Bescuher der Botschafterregion 'Muschelplateau'.
als einen Besucher der Botschafterregion 'Muschelplateau'.
</text>
</string>
<string name="stardust">

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<terrains xmlns="http://tempuri.org/terrains.xsd">
<terrains>
<!-- defaults: walk="yes" sail="yes" fly="yes" shallow="yes" swim="no" forest="no" sea="no" land="yes" forbidden="no" arctic="no" cavalry="no" -->
<terrain name="ocean" size="100" shallow="no" walk="no" swim="yes" land="no" sea="yes" />
<terrain name="plain" size="10000" road="50" shallow="no" forest="yes" cavalry="yes" seed="3">
@ -85,4 +85,4 @@
<terrain name="hall1" sail="no" fly="no" size="0" />
<terrain name="corridor1" sail="no" fly="no" size="0" />
<terrain name="wall1" forbidden="yes" size="0" />
</terrains>
</terrains>