mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-18 07:39:08 +00:00
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
This commit is contained in:
parent
fac0056731
commit
6b923d306b
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user