summaryrefslogtreecommitdiff
path: root/src/resources/db/chardb.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-06-21 20:18:38 +0300
committerAndrei Karas <akaras@inbox.ru>2016-06-21 21:45:47 +0300
commit95227e7c07251c8f59164050543c3c134aff238f (patch)
tree1b45789ca770f7251a557281da22892923470a68 /src/resources/db/chardb.cpp
parentae351c43eca44c532404deb9f10bf3e4b97406bf (diff)
downloadmanaplus-95227e7c07251c8f59164050543c3c134aff238f.tar.gz
manaplus-95227e7c07251c8f59164050543c3c134aff238f.tar.bz2
manaplus-95227e7c07251c8f59164050543c3c134aff238f.tar.xz
manaplus-95227e7c07251c8f59164050543c3c134aff238f.zip
Add support for items with cards in charcreation.xml
Diffstat (limited to 'src/resources/db/chardb.cpp')
-rw-r--r--src/resources/db/chardb.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/resources/db/chardb.cpp b/src/resources/db/chardb.cpp
index d085f690c..55c97a63f 100644
--- a/src/resources/db/chardb.cpp
+++ b/src/resources/db/chardb.cpp
@@ -22,6 +22,7 @@
#include "resources/db/chardb.h"
#include "configuration.h"
+#include "itemcolormanager.h"
#include "logger.h"
#include "debug.h"
@@ -40,7 +41,7 @@ namespace
unsigned mMaxLook = 0;
unsigned mMinRace = 0;
unsigned mMaxRace = 30;
- std::vector<int> mDefaultItems;
+ std::vector<BeingSlot> mDefaultItems;
} // namespace
void CharDB::load()
@@ -85,7 +86,18 @@ void CharDB::load()
{
const int id = XML::getProperty(node, "id", 0);
if (id > 0)
- mDefaultItems.push_back(id);
+ {
+ BeingSlot slot;
+ slot.spriteId = id;
+ for (int f = 0; f < maxCards; f ++)
+ {
+ const std::string cardName = strprintf("card%d", f + 1);
+ slot.cardsId.cards[f] = XML::getProperty(node,
+ cardName.c_str(),
+ 0);
+ }
+ mDefaultItems.push_back(slot);
+ }
}
else if (xmlNameEqual(node, "race"))
{
@@ -170,7 +182,7 @@ unsigned CharDB::getMaxRace()
return mMaxRace;
}
-const std::vector<int> &CharDB::getDefaultItems()
+const std::vector<BeingSlot> &CharDB::getDefaultItems()
{
return mDefaultItems;
}