diff options
author | Strangerke | 2011-08-20 00:03:44 +0200 |
---|---|---|
committer | Strangerke | 2011-08-20 00:03:44 +0200 |
commit | 749cd3b1159d132a2dc58afdf1817b1cee41f634 (patch) | |
tree | b4dccf461927b59a803ebe0c6ee288c1c072fd82 /engines/cge | |
parent | bda1afdbfb3e080441db5557667264e57c29e98e (diff) | |
download | scummvm-rg350-749cd3b1159d132a2dc58afdf1817b1cee41f634.tar.gz scummvm-rg350-749cd3b1159d132a2dc58afdf1817b1cee41f634.tar.bz2 scummvm-rg350-749cd3b1159d132a2dc58afdf1817b1cee41f634.zip |
CGE: Another fix for the pathfinding
Diffstat (limited to 'engines/cge')
-rw-r--r-- | engines/cge/walk.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/engines/cge/walk.cpp b/engines/cge/walk.cpp index 914f6db669..ccbb0e5532 100644 --- a/engines/cge/walk.cpp +++ b/engines/cge/walk.cpp @@ -47,12 +47,6 @@ bool Cluster::isValid() const { return (_a >= 0) && (_a < kMapXCnt) && (_b >= 0) && (_b < kMapZCnt); } -bool Cluster::chkBar() const { - assert(_vm->_now <= _vm->_caveMax); - return (_a < 0) || (_b < 0) || (_a >= _vm->_barriers[_vm->_now]._horz) || - (_b >= _vm->_barriers[_vm->_now]._vert); -} - Cluster XZ(int x, int y) { if (y < kMapTop) y = kMapTop; @@ -230,6 +224,11 @@ void Walk::noWay() { _vm->trouble(kSeqNoWay, kNoWay); } +bool Cluster::chkBar() const { + assert(_vm->_now <= _vm->_caveMax); + return (_a == _vm->_barriers[_vm->_now]._horz) || (_b == _vm->_barriers[_vm->_now]._vert); +} + bool Walk::find1Way(Cluster c) { Cluster start = c; const Cluster tab[4] = { Cluster(-1, 0), Cluster(1, 0), Cluster(0, -1), Cluster(0, 1)}; @@ -251,7 +250,6 @@ bool Walk::find1Way(Cluster c) { // Location is occupied return false; - // Loop through each direction for (int i = 0; i < tabLen; i++) { // Reset to starting position |