Kleine Fehler bereinigt

This commit is contained in:
Enno Rehling 2001-12-30 09:10:36 +00:00
parent 6084a67a31
commit a869f4bcd2
1 changed files with 6 additions and 5 deletions

View File

@ -136,7 +136,9 @@ resourcename(const resource_type * rtype, int flags)
if (rtype->name) return rtype->name(rtype, flags); if (rtype->name) return rtype->name(rtype, flags);
if (flags & NMF_PLURAL) i = 1; if (flags & NMF_PLURAL) i = 1;
if (flags & NMF_APPEARANCE) return rtype->_appearance[i]; if (flags & NMF_APPEARANCE && rtype->_appearance[i]) {
return rtype->_appearance[i];
}
return rtype->_name[i]; return rtype->_name[i];
} }
@ -2604,11 +2606,11 @@ tagbegin(struct xml_stack * stack, void * data)
if (tmp!=NULL) { if (tmp!=NULL) {
appearance[0] = strdup(tmp); appearance[0] = strdup(tmp);
appearance[1] = strcat(strcpy((char*)malloc(strlen(tmp)+3), tmp), "_p"); appearance[1] = strcat(strcpy((char*)malloc(strlen(tmp)+3), tmp), "_p");
state->rtype = new_resourcetype(names, appearance, flags); state->rtype = new_resourcetype((const char**)names, (const char**)appearance, flags);
free(appearance[0]); free(appearance[0]);
free(appearance[1]); free(appearance[1]);
} else { } else {
state->rtype = new_resourcetype(names, NULL, flags); state->rtype = new_resourcetype((const char**)names, NULL, flags);
} }
free(names[0]); free(names[0]);
free(names[1]); free(names[1]);
@ -2631,13 +2633,12 @@ tagbegin(struct xml_stack * stack, void * data)
int reload = xml_ivalue(tag, "reload"); int reload = xml_ivalue(tag, "reload");
double magres = xml_fvalue(tag, "magres"); double magres = xml_fvalue(tag, "magres");
unsigned int flags = WTF_NONE; unsigned int flags = WTF_NONE;
const char * damage[2] = { NULL, NULL };
assert(strcmp(stack->next->tag->name, "item")==0); assert(strcmp(stack->next->tag->name, "item")==0);
assert(state->itype!=NULL); assert(state->itype!=NULL);
state->itype->flags |= ITF_WEAPON; state->itype->flags |= ITF_WEAPON;
state->wtype = new_weapontype(state->itype, state->wtype = new_weapontype(state->itype,
flags, magres, damage, offmod, defmod, reload, skill, minskill); flags, magres, NULL, offmod, defmod, reload, skill, minskill);
} else if (strcmp(tag->name, "damage")==0) { } else if (strcmp(tag->name, "damage")==0) {
/* damage of a weapon */ /* damage of a weapon */
int pos = 0; int pos = 0;