summaryrefslogtreecommitdiff
path: root/src/resources/db/itemdb.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-06-18 22:03:20 +0300
committerAndrei Karas <akaras@inbox.ru>2016-06-18 22:03:20 +0300
commitbc94e3dbe141ca257363850077d3faf48338fb87 (patch)
treefa5dd9a6bcc0f4d35fffc3717203c8a45425195f /src/resources/db/itemdb.cpp
parentafb663b60d9e946ce0b23f42e033bb94a99f26a2 (diff)
downloadplus-bc94e3dbe141ca257363850077d3faf48338fb87.tar.gz
plus-bc94e3dbe141ca257363850077d3faf48338fb87.tar.bz2
plus-bc94e3dbe141ca257363850077d3faf48338fb87.tar.xz
plus-bc94e3dbe141ca257363850077d3faf48338fb87.zip
Fix asserts about not found translated item names.
Diffstat (limited to 'src/resources/db/itemdb.cpp')
-rw-r--r--src/resources/db/itemdb.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/resources/db/itemdb.cpp b/src/resources/db/itemdb.cpp
index d79f75933..be196f615 100644
--- a/src/resources/db/itemdb.cpp
+++ b/src/resources/db/itemdb.cpp
@@ -301,6 +301,7 @@ void ItemDB::loadXmlFile(const std::string &fileName,
const int inherit = XML::getProperty(node, "inherit", -1);
std::string name = XML::langProperty(node, "name", "");
+ std::string nameEn = XML::getProperty(node, "name", "");
std::string image = XML::getProperty(node, "image", "");
std::string floor = XML::getProperty(node, "floor", "");
std::string description = XML::langProperty(node, "description", "");
@@ -383,6 +384,11 @@ void ItemDB::loadXmlFile(const std::string &fileName,
name = inheritItemInfo->getName();
// TRANSLATORS: item info name
itemInfo->setName(name.empty() ? _("unnamed") : name);
+ if (nameEn.empty())
+ itemInfo->setNameEn(name.empty() ? _("unnamed") : name);
+ else
+ itemInfo->setNameEn(nameEn);
+
if (description.empty() && inheritItemInfo)
description = inheritItemInfo->getDescription();
itemInfo->setDescription(description);
@@ -606,6 +612,11 @@ void ItemDB::loadXmlFile(const std::string &fileName,
temp = normalize(name);
mNamedItemInfos[temp] = itemInfo;
}
+ if (!nameEn.empty())
+ {
+ temp = normalize(nameEn);
+ mNamedItemInfos[temp] = itemInfo;
+ }
if (!attackAction.empty())
{