diff options
Diffstat (limited to 'src/resources/db/itemdb.cpp')
-rw-r--r-- | src/resources/db/itemdb.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/resources/db/itemdb.cpp b/src/resources/db/itemdb.cpp index b4af71c17..9a815bed6 100644 --- a/src/resources/db/itemdb.cpp +++ b/src/resources/db/itemdb.cpp @@ -1056,6 +1056,22 @@ static void loadOrderSprite(ItemInfo *const itemInfo, itemInfo->setDrawPriority(direction, priority); } +std::string ItemDB::getNamesStr(const std::vector<int> &parts) +{ + std::string str; + FOR_EACH (std::vector<int>::const_iterator, it, parts) + { + const int id = *it; + if (exists(id)) + { + if (!str.empty()) + str.append(","); + str.append(get(id).getName()); + } + } + return str; +} + #ifdef UNITTESTS ItemDB::NamedItemInfos &ItemDB::getNamedItemInfosTest() { |