diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-08-17 00:06:19 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-08-17 00:06:19 +0300 |
commit | 9fe27169625eb51dbab172bb3d9cb27a06141486 (patch) | |
tree | 0347bc106298ce724ead731f92df6ad0ee5edae5 /src | |
parent | ead2b06e3496b0cbe3a4a4c33a55c8262f02b73f (diff) | |
download | manaplus-9fe27169625eb51dbab172bb3d9cb27a06141486.tar.gz manaplus-9fe27169625eb51dbab172bb3d9cb27a06141486.tar.bz2 manaplus-9fe27169625eb51dbab172bb3d9cb27a06141486.tar.xz manaplus-9fe27169625eb51dbab172bb3d9cb27a06141486.zip |
Use color selected on card for items.
Diffstat (limited to 'src')
-rw-r--r-- | src/itemcolormanager.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/itemcolormanager.cpp b/src/itemcolormanager.cpp index 31f4c333c..55ec558ac 100644 --- a/src/itemcolormanager.cpp +++ b/src/itemcolormanager.cpp @@ -22,9 +22,20 @@ #include "resources/iteminfo.h" +#include "resources/db/itemdb.h" + #include "debug.h" ItemColor ItemColorManager::getColorFromCards(const int *const cards) { + if (!cards) + return ItemColor_one; + for (int f = 0; f < 4; f ++) + { + const ItemInfo &info = ItemDB::get(cards[f]); + const ItemColor &color = info.getCardColor(); + if (color != ItemColor_zero) + return color; + } return ItemColor_one; } |