fix error checking during tile processing
noticed following a patch last night
This commit is contained in:
@@ -110,7 +110,7 @@ read_txttile(FILE *txtfile, pixel (*pixels)[TILE_X])
|
||||
int ph, i, j, k, reslt;
|
||||
char buf[BUFSZ], ttype[BUFSZ], gend[BUFSZ];
|
||||
const char *p;
|
||||
char c[2];
|
||||
char c[2], *q;
|
||||
static int gidx = 0;
|
||||
|
||||
gend[0] = '\0';
|
||||
@@ -133,11 +133,18 @@ read_txttile(FILE *txtfile, pixel (*pixels)[TILE_X])
|
||||
* change when tiles are added
|
||||
*/
|
||||
p = tilename(tile_set, tile_set_indx, gidx);
|
||||
if (p && strcmp(p, buf)
|
||||
&& !acceptable_tilename(tile_set, tile_set_indx, buf, p)) {
|
||||
Fprintf(stderr, "warning: for tile %d (numbered %d) of %s,\n",
|
||||
tile_set_indx, i, text_sets[tile_set]);
|
||||
Fprintf(stderr, "\tfound '%s' while expecting '%s'\n", buf, p);
|
||||
if (p && (q = strstr(p, " {")) != 0) {
|
||||
*q = '\0';
|
||||
}
|
||||
if (p && strcmp(p, buf)) {
|
||||
boolean other_mismatch =
|
||||
(tile_set == OTHER_SET
|
||||
&& !acceptable_tilename(tile_set, tile_set_indx, buf, p));
|
||||
if (tile_set != OTHER_SET || other_mismatch) {
|
||||
Fprintf(stderr, "warning: for tile %d (numbered %d) of %s,\n",
|
||||
tile_set_indx, i, text_sets[tile_set]);
|
||||
Fprintf(stderr, "\tfound '%s' while expecting '%s'\n", buf, p);
|
||||
}
|
||||
}
|
||||
tile_set_indx++;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user