From 9fe27169625eb51dbab172bb3d9cb27a06141486 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 17 Aug 2015 00:06:19 +0300 Subject: Use color selected on card for items. --- src/itemcolormanager.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/itemcolormanager.cpp') 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; } -- cgit v1.2.3-60-g2f50