From 8dd47e51d9c318e522b21f28bc3e3935ef692056 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 4 Jul 2013 21:11:28 +0300 Subject: add missing checks. also fix crash in creating character with broken data. --- src/gui/palette.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui/palette.cpp') 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; -- cgit v1.2.3-70-g09d2