From 88d370a7b8e1434c2a20f9a9564478a401041461 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Tue, 21 Apr 2015 12:35:39 +0200 Subject: [PATCH] fixing sea serpent names https://bugs.eressea.de/view.php?id=2057 --- src/kernel/save.c | 4 ++-- src/kernel/unit.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/kernel/save.c b/src/kernel/save.c index a27a6bae8..ef89b9daf 100644 --- a/src/kernel/save.c +++ b/src/kernel/save.c @@ -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); } } diff --git a/src/kernel/unit.c b/src/kernel/unit.c index a946caae0..0c6fcedd1 100644 --- a/src/kernel/unit.c +++ b/src/kernel/unit.c @@ -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;