diff options
author | Oystein Eftevaag | 2006-03-19 07:54:30 +0000 |
---|---|---|
committer | Oystein Eftevaag | 2006-03-19 07:54:30 +0000 |
commit | d34d6b17dfc72a1f2f15ce24d5ae12240809afea (patch) | |
tree | 86e8ae8be0668218232695d7e75e6809d1f81b49 /engines | |
parent | e636a25a3313da26225e0f5518a67f54092e78e1 (diff) | |
download | scummvm-rg350-d34d6b17dfc72a1f2f15ce24d5ae12240809afea.tar.gz scummvm-rg350-d34d6b17dfc72a1f2f15ce24d5ae12240809afea.tar.bz2 scummvm-rg350-d34d6b17dfc72a1f2f15ce24d5ae12240809afea.zip |
Fixes a potential problem in the pathfinder where an array could be accessed with a negative value in certain rooms
svn-id: r21378
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/scene.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/engines/kyra/scene.cpp b/engines/kyra/scene.cpp index ebf6bdc464..ff2ffda549 100644 --- a/engines/kyra/scene.cpp +++ b/engines/kyra/scene.cpp @@ -1455,6 +1455,10 @@ bool KyraEngine::lineIsPassable(int x, int y) { if (y > 137) { return false; } + + if (y < 0) { + y = 0; + } int ypos = 8; if (_scaleMode) { @@ -1464,8 +1468,6 @@ bool KyraEngine::lineIsPassable(int x, int y) { } x -= (ypos >> 1); - if (y < 0) - y = 0; int xpos = x; int xtemp = xpos + ypos - 1; |