summaryrefslogtreecommitdiff
path: root/src/itemcolormanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-05-13 22:03:58 +0300
committerAndrei Karas <akaras@inbox.ru>2016-05-13 22:03:58 +0300
commit546d5180247512270a2ccd114266fb36cd426e61 (patch)
treec87626cf176fef05e503637d3f68a79102a9a8fe /src/itemcolormanager.cpp
parent9d93ff1cf9e33ec1304a7deadd84bfd690110142 (diff)
downloadmanaplus-546d5180247512270a2ccd114266fb36cd426e61.tar.gz
manaplus-546d5180247512270a2ccd114266fb36cd426e61.tar.bz2
manaplus-546d5180247512270a2ccd114266fb36cd426e61.tar.xz
manaplus-546d5180247512270a2ccd114266fb36cd426e61.zip
Add check asserts in ItemDB. Also fix new asserts from log.
Diffstat (limited to 'src/itemcolormanager.cpp')
-rw-r--r--src/itemcolormanager.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/itemcolormanager.cpp b/src/itemcolormanager.cpp
index 9344ff856..0cf48015b 100644
--- a/src/itemcolormanager.cpp
+++ b/src/itemcolormanager.cpp
@@ -32,9 +32,18 @@ ItemColor ItemColorManager::getColorFromCards(const int *const cards)
{
if (!cards)
return ItemColor_one;
+ if (cards[0] == CARD0_FORGE ||
+ cards[0] == CARD0_CREATE ||
+ cards[0] == CARD0_PET)
+ {
+ return ItemColor_one;
+ }
for (int f = 0; f < maxCards; f ++)
{
- const ItemInfo &info = ItemDB::get(cards[f]);
+ const int id = cards[f];
+ if (id == 0)
+ continue;
+ const ItemInfo &info = ItemDB::get(id);
const ItemColor &color = info.getCardColor();
if (color != ItemColor_zero)
return color;