* 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);
if (strcmp(zName, "none")==0) {
*rp = NULL;
return AT_READ_FAIL;
return AT_READ_OK;
}
*rp = rc_find(zName);
assert(*rp!=NULL);

View File

@ -230,7 +230,7 @@ a_age(attrib ** p)
* hat Einfluß auf den Besitzer */
while(*ap) {
attrib * a = *ap;
if(a->type->age && a->type->age(a)==0) a_remove(p, a);
if (a->type->age && a->type->age(a)==0) a_remove(p, a);
else ap=&a->next;
}
return (*p!=NULL);
@ -264,6 +264,7 @@ a_read(FILE * f, attrib ** attribs)
a_add(attribs, na);
break;
case AT_READ_FAIL:
log_warning(("reading attribute %s failed.", zText));
a_free(na);
break;
default:

View File

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