diff options
author | Robert Göffringmann | 2003-07-17 00:35:32 +0000 |
---|---|---|
committer | Robert Göffringmann | 2003-07-17 00:35:32 +0000 |
commit | 76de27e09719b9e92690ab9c909c396dbc29464e (patch) | |
tree | 666b5f021c391fa6ceb6a49de4cd6652c0aec67a /sky | |
parent | 301f1cdf08bdfb393a945d9c268ed23f78f84f6b (diff) | |
download | scummvm-rg350-76de27e09719b9e92690ab9c909c396dbc29464e.tar.gz scummvm-rg350-76de27e09719b9e92690ab9c909c396dbc29464e.tar.bz2 scummvm-rg350-76de27e09719b9e92690ab9c909c396dbc29464e.zip |
fix additional array read
svn-id: r9054
Diffstat (limited to 'sky')
-rw-r--r-- | sky/autoroute.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sky/autoroute.cpp b/sky/autoroute.cpp index 73e64576e2..0e79092cf2 100644 --- a/sky/autoroute.cpp +++ b/sky/autoroute.cpp @@ -106,12 +106,6 @@ uint16 SkyAutoRoute::autoRoute(Compact *cpt, uint16 **pSaveRoute) { // next_stretch: routeCalc--; bitsLeft--; - if (!bitsLeft) { - gridData = screenGrid[0] | (screenGrid[1] << 8) | - (screenGrid[2] << 16) | (screenGrid[3] << 24); - screenGrid -= 4; - bitsLeft = 32; - } // still bits: gridCntX--; if (gridCntX == 0) { @@ -122,6 +116,12 @@ uint16 SkyAutoRoute::autoRoute(Compact *cpt, uint16 **pSaveRoute) { stretch1 = 0; // clear stretch factor gridCntY--; } + if (gridCntY && (!bitsLeft)) { + gridData = screenGrid[0] | (screenGrid[1] << 8) | + (screenGrid[2] << 16) | (screenGrid[3] << 24); + screenGrid -= 4; + bitsLeft = 32; + } } while(gridCntY); for (cnt = 0; cnt < ROUTE_GRID_WIDTH - 1; cnt++) _routeGrid[cnt] = 0; // clear top line (right hand edge already done |