diff options
author | Florian Kagerer | 2010-02-09 21:09:29 +0000 |
---|---|---|
committer | Florian Kagerer | 2010-02-09 21:09:29 +0000 |
commit | 9b6042efb489ea80729b43421aa1a082c20a7ed5 (patch) | |
tree | 9d969d26f52c02780c013bf33673acb4e44a3c2e /engines/kyra | |
parent | a4039182ce8ce21b33b13d3df675113325f555b9 (diff) | |
download | scummvm-rg350-9b6042efb489ea80729b43421aa1a082c20a7ed5.tar.gz scummvm-rg350-9b6042efb489ea80729b43421aa1a082c20a7ed5.tar.bz2 scummvm-rg350-9b6042efb489ea80729b43421aa1a082c20a7ed5.zip |
LOL: fixed script bug in castle cimmeria that would cause out of bounds mem access (should fix bug #2948109)
svn-id: r48016
Diffstat (limited to 'engines/kyra')
-rw-r--r-- | engines/kyra/scene_lol.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/engines/kyra/scene_lol.cpp b/engines/kyra/scene_lol.cpp index 8fcf3d6839..ddc6e41bec 100644 --- a/engines/kyra/scene_lol.cpp +++ b/engines/kyra/scene_lol.cpp @@ -1959,10 +1959,12 @@ void LoLEngine::drawSceneShapes() { if (!(w & 8)) continue; - uint16 v = 20 * (s - _dscUnk2[s]); + uint16 v = 20 * (s - (s < 23 ? _dscUnk2[s] : 0)); + if (v > 80) + v = 80; scaleLevelShapesDim(t, dimY1, dimY2, 13); - drawDoor(_doorShapes[_dscDoorShpIndex[s]], 0, t, 10, 0, -v, 2); + drawDoor(_doorShapes[(s < 23 ? _dscDoorShpIndex[s] : 0)], 0, t, 10, 0, -v, 2); setLevelShapesDim(t, dimY1, dimY2, 13); } } |