diff options
author | Paul Gilbert | 2017-11-17 20:52:18 -0500 |
---|---|---|
committer | Paul Gilbert | 2017-11-17 20:52:18 -0500 |
commit | 7361da9fdcad566a46d24e2b32711173039482d5 (patch) | |
tree | 859d8e541429c8d2024c8e6cbbb250e759d29a94 /engines/xeen/spells.cpp | |
parent | ef8cf2a543ad04e971c7b09290f2d46ca0a3a4eb (diff) | |
download | scummvm-rg350-7361da9fdcad566a46d24e2b32711173039482d5.tar.gz scummvm-rg350-7361da9fdcad566a46d24e2b32711173039482d5.tar.bz2 scummvm-rg350-7361da9fdcad566a46d24e2b32711173039482d5.zip |
XEEN: Fix Coverity identified problems
Diffstat (limited to 'engines/xeen/spells.cpp')
-rw-r--r-- | engines/xeen/spells.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/engines/xeen/spells.cpp b/engines/xeen/spells.cpp index 5c5a62ef45..2f9fe46329 100644 --- a/engines/xeen/spells.cpp +++ b/engines/xeen/spells.cpp @@ -449,10 +449,11 @@ void Spells::detectMonster() { MazeMonster &monster = map._mobData._monsters[monIndex]; Common::Point pt = party._mazePosition + Common::Point(xDiff, yDiff); if (monster._position == pt) { - if (++grid[yDiff][xDiff] > 3) - grid[yDiff][xDiff] = 3; + int &gridEntry = grid[yDiff + 3][xDiff + 3]; + if (++gridEntry > 3) + gridEntry = 3; - sprites.draw(w, grid[yDiff][xDiff], Common::Point(xDiff * 9 + 244, + sprites.draw(w, gridEntry, Common::Point(xDiff * 9 + 244, yDiff * 7 + 81)); } } |