summaryrefslogtreecommitdiff
path: root/src/gui/palette.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-07-04 21:11:28 +0300
committerAndrei Karas <akaras@inbox.ru>2013-07-04 21:11:28 +0300
commit8dd47e51d9c318e522b21f28bc3e3935ef692056 (patch)
tree30b364f3f1b04fd31efec47332d193567894997f /src/gui/palette.cpp
parentd1d205fbe0c2d63bbd08742c56f00852ccc0523b (diff)
downloadplus-8dd47e51d9c318e522b21f28bc3e3935ef692056.tar.gz
plus-8dd47e51d9c318e522b21f28bc3e3935ef692056.tar.bz2
plus-8dd47e51d9c318e522b21f28bc3e3935ef692056.tar.xz
plus-8dd47e51d9c318e522b21f28bc3e3935ef692056.zip
add missing checks.
also fix crash in creating character with broken data.
Diffstat (limited to 'src/gui/palette.cpp')
-rw-r--r--src/gui/palette.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/palette.cpp b/src/gui/palette.cpp
index abd328458..1b25620a9 100644
--- a/src/gui/palette.cpp
+++ b/src/gui/palette.cpp
@@ -127,7 +127,7 @@ void Palette::advanceGradient()
% (delay * numOfColors);
const int gradIndex = elem->gradientIndex;
- const int pos = gradIndex % delay;
+ const int pos = delay ? (gradIndex % delay) : gradIndex;
int colIndex;
if (delay)
colIndex = gradIndex / delay;