summaryrefslogtreecommitdiff
path: root/src/resources/db/itemoptiondb.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-04-21 20:36:23 +0300
committerAndrei Karas <akaras@inbox.ru>2017-04-21 20:37:02 +0300
commite465ecdf0c7f867a62236a5a0945a85f35eee039 (patch)
tree7bc97c683d542f11a1f5b069e77cf70f552d14fe /src/resources/db/itemoptiondb.cpp
parent862e8f821789014b6167f37976b80694d6d310e3 (diff)
downloadmanaplus-e465ecdf0c7f867a62236a5a0945a85f35eee039.tar.gz
manaplus-e465ecdf0c7f867a62236a5a0945a85f35eee039.tar.bz2
manaplus-e465ecdf0c7f867a62236a5a0945a85f35eee039.tar.xz
manaplus-e465ecdf0c7f867a62236a5a0945a85f35eee039.zip
Show item options in item popups.
Diffstat (limited to 'src/resources/db/itemoptiondb.cpp')
-rw-r--r--src/resources/db/itemoptiondb.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/resources/db/itemoptiondb.cpp b/src/resources/db/itemoptiondb.cpp
index becdf7406..504199bfc 100644
--- a/src/resources/db/itemoptiondb.cpp
+++ b/src/resources/db/itemoptiondb.cpp
@@ -36,6 +36,7 @@
namespace
{
ItemOptionDb::OptionInfos mOptions;
+ const std::vector<ItemFieldType*> mEmptyOption;
bool mLoaded = false;
} // namespace
@@ -141,3 +142,11 @@ void ItemOptionDb::unload()
mOptions.clear();
mLoaded = false;
}
+
+const std::vector<ItemFieldType*> &ItemOptionDb::getFields(const int id)
+{
+ OptionInfos::const_iterator it = mOptions.find(id);
+ if (it == mOptions.end())
+ return mEmptyOption;
+ return (*it).second;
+}