* Bugfix einlesen von null-rassen

* Bugfix einlesen von fehlerhaften events
* Log-Message bei kaputten attributen und events. log beachten!
This commit is contained in:
Enno Rehling 2002-04-07 09:58:22 +00:00
parent c866a32435
commit 45c51f71bf
3 changed files with 6 additions and 2 deletions

View File

@ -570,7 +570,7 @@ read_race_reference(const struct race ** rp, FILE * F)
fscanf(F, "%s", zName); fscanf(F, "%s", zName);
if (strcmp(zName, "none")==0) { if (strcmp(zName, "none")==0) {
*rp = NULL; *rp = NULL;
return AT_READ_FAIL; return AT_READ_OK;
} }
*rp = rc_find(zName); *rp = rc_find(zName);
assert(*rp!=NULL); assert(*rp!=NULL);

View File

@ -264,6 +264,7 @@ a_read(FILE * f, attrib ** attribs)
a_add(attribs, na); a_add(attribs, na);
break; break;
case AT_READ_FAIL: case AT_READ_FAIL:
log_warning(("reading attribute %s failed.", zText));
a_free(na); a_free(na);
break; break;
default: default:

View File

@ -17,6 +17,7 @@
/* util includes */ /* util includes */
#include "attrib.h" #include "attrib.h"
#include "log.h"
/* libc includes */ /* libc includes */
#include <assert.h> #include <assert.h>
@ -54,7 +55,9 @@ read_triggers(FILE * F, trigger ** tp)
tp = &(*tp)->next; tp = &(*tp)->next;
break; break;
case AT_READ_FAIL: case AT_READ_FAIL:
log_warning(("reading trigger for %s failed.", ttype->name));
t_free(*tp); t_free(*tp);
*tp = NULL;
break; break;
default: default:
assert(!"invalid return value"); assert(!"invalid return value");