Merge pull request #174 from badgerman/develop

fixing sea serpent names
This commit is contained in:
Enno Rehling 2015-04-21 12:52:11 +02:00
commit 4ea14398e8
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);
sc_mage *mage;
if (gdata.version < AUTO_RACENAME_VERSION) {
if (gdata.version < JSON_REPORT_VERSION) {
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);
}
}

View File

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