diff options
author | James Brown | 2004-01-16 09:05:57 +0000 |
---|---|---|
committer | James Brown | 2004-01-16 09:05:57 +0000 |
commit | 6b923d306b456d99aef27b4b16c27855ed524d9a (patch) | |
tree | 733e2683dbdf8416c59eb6815405b4113849cac6 /scumm/actor.cpp | |
parent | fac00567314ee0d736607fb1070a87608fd87833 (diff) | |
download | scummvm-rg350-6b923d306b456d99aef27b4b16c27855ed524d9a.tar.gz scummvm-rg350-6b923d306b456d99aef27b4b16c27855ed524d9a.tar.bz2 scummvm-rg350-6b923d306b456d99aef27b4b16c27855ed524d9a.zip |
Hack for infinite loop in walkbox code - hacks around Maniac bug #862245 (fixes is a strong word for a breakout counter hack :)
svn-id: r12428
Diffstat (limited to 'scumm/actor.cpp')
-rw-r--r-- | scumm/actor.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp index 4fac4740b2..b2b5b2cf28 100644 --- a/scumm/actor.cpp +++ b/scumm/actor.cpp @@ -1477,7 +1477,7 @@ void Actor::walkActorV12() { void Actor::walkActorOld() { Common::Point p2, p3; // Gate locations - int new_dir, next_box; + int new_dir, next_box, loopCtr = 0; if (!moving) return; @@ -1515,6 +1515,7 @@ void Actor::walkActorOld() { moving &= ~MF_NEW_LEG; do { + loopCtr++; if (walkbox == kInvalidBox) { setBox(walkdata.destbox); @@ -1572,6 +1573,13 @@ void Actor::walkActorOld() { setBox(walkdata.destbox); else setBox(walkdata.curbox); + + // FIXME: Ender added this recursion counter as a hack around + // a infinite loop in Maniac V1 - see bug #862245 + if (loopCtr > 10000) { + moving |= MF_LAST_LEG; + return; + } } while (1); moving |= MF_LAST_LEG; |