forked from github/server
Der server mag es nicht, wenn Rassen ein space im internal name haben, weil
trigger den rassennamen ohne "" schreiben. also operiere ich die mal raus, spaces soll man da auch nicht haben.
This commit is contained in:
parent
923ea5bcf8
commit
b252b00163
|
@ -85,6 +85,10 @@ rc_new(const char * zName)
|
|||
{
|
||||
char zBuffer[80];
|
||||
race * rc = calloc(sizeof(race), 1);
|
||||
if (strchr(zName, ' ')!=NULL) {
|
||||
log_error(("race '%s' has an invalid name. remove spaces\n", zName));
|
||||
assert(strchr(zName, ' ')==NULL);
|
||||
}
|
||||
strcpy(zBuffer, zName);
|
||||
rc->_name[0] = strdup(zBuffer);
|
||||
sprintf(zBuffer, "%s_p", zName);
|
||||
|
|
|
@ -1063,8 +1063,17 @@ readunit(FILE * F)
|
|||
u->race = new_race[(race_t)ri(F)];
|
||||
u->irace = new_race[(race_t)ri(F)];
|
||||
} else {
|
||||
char * space;
|
||||
|
||||
rs(F, buf);
|
||||
if (strcmp(buf, "giant turtle")==0) strcpy(buf, "giantturtle");
|
||||
space = strchr(buf, ' ');
|
||||
while (space!=NULL) {
|
||||
strcpy(space, space+1);
|
||||
space=strchr(space, ' ');
|
||||
}
|
||||
/* if (strcmp(buf, "giant turtle")==0) strcpy(buf, "giantturtle");
|
||||
if (strcmp(buf, "young dragon")==0) strcpy(buf, "youngdragon");
|
||||
if (strcmp(buf, "young dragon")==0) strcpy(buf, "youngdragon"); */
|
||||
u->race = rc_find(buf);
|
||||
assert(u->race);
|
||||
rs(F, buf);
|
||||
|
|
Loading…
Reference in New Issue