aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/animator_hof.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2010-01-29 22:43:23 +0000
committerJohannes Schickel2010-01-29 22:43:23 +0000
commit595a2e16f15ce73fe7c7ae0a31f33ca760356ff0 (patch)
tree17dbae19b5bbad762f07d648425125ef69d8fb11 /engines/kyra/animator_hof.cpp
parent027b44673a62da07ca5cf913f93b86261d10f3bb (diff)
downloadscummvm-rg350-595a2e16f15ce73fe7c7ae0a31f33ca760356ff0.tar.gz
scummvm-rg350-595a2e16f15ce73fe7c7ae0a31f33ca760356ff0.tar.bz2
scummvm-rg350-595a2e16f15ce73fe7c7ae0a31f33ca760356ff0.zip
Fix use of undefined behavior. (Thanks to syke for reporting)
svn-id: r47685
Diffstat (limited to 'engines/kyra/animator_hof.cpp')
-rw-r--r--engines/kyra/animator_hof.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/kyra/animator_hof.cpp b/engines/kyra/animator_hof.cpp
index 7609b3009d..e1471239da 100644
--- a/engines/kyra/animator_hof.cpp
+++ b/engines/kyra/animator_hof.cpp
@@ -123,7 +123,7 @@ void KyraEngine_HoF::updateItemAnimations() {
const ItemAnimData_v2 *s = &_itemAnimData[_nextAnimItem];
ActiveItemAnim *a = &_activeItemAnim[_nextAnimItem];
- _nextAnimItem = ++_nextAnimItem % _itemAnimDataSize;
+ _nextAnimItem = (_nextAnimItem + 1) % _itemAnimDataSize;
uint32 ctime = _system->getMillis();
if (ctime < a->nextFrame)
@@ -168,7 +168,7 @@ void KyraEngine_HoF::updateItemAnimations() {
if (nextFrame) {
a->nextFrame = _system->getMillis() + (s->frames[a->currentFrame].delay * _tickLength);
- a->currentFrame = ++a->currentFrame % s->numFrames;
+ a->currentFrame = (a->currentFrame + 1) % s->numFrames;
}
}