summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/widgets/browserbox.cpp9
-rw-r--r--src/resources/db/mercenarydb.cpp4
2 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp
index 182f10507..94758e78f 100644
--- a/src/gui/widgets/browserbox.cpp
+++ b/src/gui/widgets/browserbox.cpp
@@ -46,6 +46,7 @@
#include "resources/db/homunculusdb.h"
#include "resources/db/itemdb.h"
+#include "resources/db/mercenarydb.h"
#include "resources/db/monsterdb.h"
#include "resources/db/petdb.h"
#endif // DYECMD
@@ -279,6 +280,14 @@ void BrowserBox::addRow(const std::string &row, const bool atTop)
if (info)
bLink.caption = info->getName();
}
+ else if (!link.empty() && link[0] == 'M')
+ { // homunculus link
+ const BeingTypeId id = static_cast<BeingTypeId>(
+ atoi(bLink.link.substr(1).c_str()));
+ BeingInfo *info = MercenaryDB::get(id);
+ if (info)
+ bLink.caption = info->getName();
+ }
else
{ // item link
size_t idx = bLink.link.find(",");
diff --git a/src/resources/db/mercenarydb.cpp b/src/resources/db/mercenarydb.cpp
index 9e7ccf511..4b12e96ff 100644
--- a/src/resources/db/mercenarydb.cpp
+++ b/src/resources/db/mercenarydb.cpp
@@ -27,6 +27,7 @@
#include "utils/checkutils.h"
#include "utils/dtor.h"
+#include "utils/gettext.h"
#include "configuration.h"
@@ -95,6 +96,9 @@ void MercenaryDB::loadXmlFile(const std::string &fileName,
currentInfo = new BeingInfo;
currentInfo->setBlockType(BlockType::NONE);
+ currentInfo->setName(XML::langProperty(
+ // TRANSLATORS: unknown info name
+ mercenaryNode, "name", _("unnamed")));
BeingCommon::readBasicAttributes(currentInfo, mercenaryNode, "attack");
BeingCommon::readWalkingAttributes(currentInfo, mercenaryNode, 0);
BeingCommon::readAiAttributes(currentInfo, mercenaryNode);