diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-02-08 23:14:24 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-02-08 23:14:24 +0300 |
commit | 86cb4a51351b8217ede6672703a1b39b91ddb572 (patch) | |
tree | 44b153d699f406f58ebd1f9b100e3bfb23e16b02 /src/resources/db/questdb.cpp | |
parent | 70fc4db1b5570beceda662e9f34ec1729610512e (diff) | |
download | manaplus-86cb4a51351b8217ede6672703a1b39b91ddb572.tar.gz manaplus-86cb4a51351b8217ede6672703a1b39b91ddb572.tar.bz2 manaplus-86cb4a51351b8217ede6672703a1b39b91ddb572.tar.xz manaplus-86cb4a51351b8217ede6672703a1b39b91ddb572.zip |
Add support for quest links in browserbox.
Diffstat (limited to 'src/resources/db/questdb.cpp')
-rw-r--r-- | src/resources/db/questdb.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/resources/db/questdb.cpp b/src/resources/db/questdb.cpp index 9df240f92..93bcada6e 100644 --- a/src/resources/db/questdb.cpp +++ b/src/resources/db/questdb.cpp @@ -241,3 +241,21 @@ std::vector<QuestEffect*> *QuestDb::getAllEffects() { return &mAllEffects; } + +std::string QuestDb::getName(const int id) +{ + std::map<int, std::vector<QuestItem*> >::const_iterator it = + mQuests.find(id); + if (it == mQuests.end()) + { + // TRANSLATORS: quests window quest name + return _("unknown"); + } + const std::vector<QuestItem*> &items = (*it).second; + if (items.empty()) + { + // TRANSLATORS: quests window quest name + return _("unknown"); + } + return items[0]->name; +} |