aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2011-08-19 21:15:59 +1000
committerPaul Gilbert2011-08-19 21:15:59 +1000
commit2b0cec1cd7b87fe971f2adc44da20e03e71991dc (patch)
tree037798f16a21204a2dd6275591ea2a52a021a292 /engines
parent372d488b3bc01f6dce06dde83d4818a010695c70 (diff)
downloadscummvm-rg350-2b0cec1cd7b87fe971f2adc44da20e03e71991dc.tar.gz
scummvm-rg350-2b0cec1cd7b87fe971f2adc44da20e03e71991dc.tar.bz2
scummvm-rg350-2b0cec1cd7b87fe971f2adc44da20e03e71991dc.zip
CGE: Fix problem with being able to walk into protected areas
Diffstat (limited to 'engines')
-rw-r--r--engines/cge/walk.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/cge/walk.cpp b/engines/cge/walk.cpp
index a418bfb178..7bce9e29e6 100644
--- a/engines/cge/walk.cpp
+++ b/engines/cge/walk.cpp
@@ -49,7 +49,8 @@ bool Cluster::isValid() const {
bool Cluster::chkBar() const {
assert(_vm->_now <= _vm->_caveMax);
- return (_a == _vm->_barriers[_vm->_now]._horz) && (_b == _vm->_barriers[_vm->_now]._vert);
+ return (_a < 0) || (_b < 0) || (_a >= _vm->_barriers[_vm->_now]._horz) ||
+ (_b >= _vm->_barriers[_vm->_now]._vert);
}
Cluster XZ(int x, int y) {