summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-09-20 20:13:38 +0300
committerAndrei Karas <akaras@inbox.ru>2012-09-20 20:13:38 +0300
commitca695ea265e4922319a76e5cec28bd4eeb1b76f0 (patch)
tree1d0953ef246c347dac5317a624e4d042adfc127d /src/gui
parentf6dbee24b6a16dc4316ee5b7ebb9863723441ec4 (diff)
downloadplus-ca695ea265e4922319a76e5cec28bd4eeb1b76f0.tar.gz
plus-ca695ea265e4922319a76e5cec28bd4eeb1b76f0.tar.bz2
plus-ca695ea265e4922319a76e5cec28bd4eeb1b76f0.tar.xz
plus-ca695ea265e4922319a76e5cec28bd4eeb1b76f0.zip
Add missing check in palette.h
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/palette.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gui/palette.h b/src/gui/palette.h
index b1111c56b..0c3c2dc87 100644
--- a/src/gui/palette.h
+++ b/src/gui/palette.h
@@ -78,11 +78,12 @@ class Palette
*/
inline const gcn::Color &getColor(int type, int alpha = 255)
{
-// if (type >= (signed)mColors.size())
-// {
-// logger->log("request type: %d", type);
-// logger->log("size: %ld", mColors.size());
-// }
+ if (type >= (signed)mColors.size())
+ {
+ logger->log("incorrect color request type: %d from %ld",
+ type, mColors.size());
+ type = 0;
+ }
gcn::Color* col = &mColors[type].color;
col->a = alpha;
return *col;