fixing sea serpent names

https://bugs.eressea.de/view.php?id=2057
This commit is contained in:
Enno Rehling 2015-04-21 12:35:39 +02:00
parent fdb0a79c07
commit 88d370a7b8
2 changed files with 3 additions and 3 deletions

View File

@ -1602,9 +1602,9 @@ int readgame(const char *filename, int backup)
unit *u = read_unit(&gdata); unit *u = read_unit(&gdata);
sc_mage *mage; sc_mage *mage;
if (gdata.version < AUTO_RACENAME_VERSION) { if (gdata.version < JSON_REPORT_VERSION) {
if (u->_name && fval(u->faction, FFL_NPC)) { if (u->_name && fval(u->faction, FFL_NPC)) {
if (unit_name_equals_race(u)) { if (!u->_name[0] || unit_name_equals_race(u)) {
unit_setname(u, NULL); unit_setname(u, NULL);
} }
} }

View File

@ -1649,7 +1649,7 @@ const char *unit_getname(const unit * u)
void unit_setname(unit * u, const char *name) void unit_setname(unit * u, const char *name)
{ {
free(u->_name); free(u->_name);
if (name) if (name && name[0])
u->_name = _strdup(name); u->_name = _strdup(name);
else else
u->_name = NULL; u->_name = NULL;