aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Göffringmann2004-10-22 17:05:29 +0000
committerRobert Göffringmann2004-10-22 17:05:29 +0000
commit13055ca424a89e8e63ef5b443be04f219b612a31 (patch)
treea5c9ffb9b6bbcdd73a53d7d97e2f46d673c50509
parent1a36eeda0ee85a37c24962be8fd3e94463585175 (diff)
downloadscummvm-rg350-13055ca424a89e8e63ef5b443be04f219b612a31.tar.gz
scummvm-rg350-13055ca424a89e8e63ef5b443be04f219b612a31.tar.bz2
scummvm-rg350-13055ca424a89e8e63ef5b443be04f219b612a31.zip
fix for bug [ 1043047 ] game hangs when foster path busy
svn-id: r15654
-rw-r--r--sky/autoroute.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/sky/autoroute.cpp b/sky/autoroute.cpp
index e6f12b3771..216a7ee771 100644
--- a/sky/autoroute.cpp
+++ b/sky/autoroute.cpp
@@ -248,8 +248,18 @@ uint16 AutoRoute::autoRoute(Compact *cpt) {
if ((startX == destX) && (startY == destY))
return 2;
- if (_routeGrid[(destY + 1) * ROUTE_GRID_WIDTH + destX + 1])
- return 1; // AR destination is an unaccessible block
+ if (_routeGrid[(destY + 1) * ROUTE_GRID_WIDTH + destX + 1]) {
+ if ((cpt == &Sky::SkyCompact::foster) && (cptScreen == 12) && (destX == 2) && (destY == 14)) {
+ /* workaround for Scriptbug #1043047
+ In screen 12 (the pipe factory) Joey can block Foster's target
+ coordinates (2/14). This is normally not too tragic, but in the
+ scene when foster gets thrown out by Lamb (first time you enter
+ the pipe factory), the game would enter an infinite loop. */
+ _routeGrid[(destY + 1) * ROUTE_GRID_WIDTH + destX + 1] = 0;
+ // hide this part joey from the grid
+ } else
+ return 1; // AR destination is an unaccessible block
+ }
if (!calcWalkGrid(startX, startY, destX, destY))
return 1; // can't find route to block