aboutsummaryrefslogtreecommitdiff
path: root/sky
diff options
context:
space:
mode:
authorRobert Göffringmann2003-04-29 13:06:01 +0000
committerRobert Göffringmann2003-04-29 13:06:01 +0000
commitcaf3ffda050e7fc92cb71e0f7eb0030fc17d81fa (patch)
tree16aa24df38b068903fb57a9791d584c142516e5d /sky
parent3cce1991a0dd8ea8f73b94dce7b0ba779ba95c39 (diff)
downloadscummvm-rg350-caf3ffda050e7fc92cb71e0f7eb0030fc17d81fa.tar.gz
scummvm-rg350-caf3ffda050e7fc92cb71e0f7eb0030fc17d81fa.tar.bz2
scummvm-rg350-caf3ffda050e7fc92cb71e0f7eb0030fc17d81fa.zip
fixed pathfinding problems (hopefully) :)
svn-id: r7199
Diffstat (limited to 'sky')
-rw-r--r--sky/autoroute.cpp6
-rw-r--r--sky/grid.cpp1
2 files changed, 5 insertions, 2 deletions
diff --git a/sky/autoroute.cpp b/sky/autoroute.cpp
index c81f902294..c66ea9e7eb 100644
--- a/sky/autoroute.cpp
+++ b/sky/autoroute.cpp
@@ -63,8 +63,10 @@ uint16 SkyAutoRoute::autoRoute(Compact *cpt, uint16 **pSaveRoute) {
if (!cpt->extCompact)
error("SkyAutoRoute::autoRoute: fatal error. cpt->extCompact == NULL!\n");
uint16* routeData = (uint16*)cpt->extCompact->animScratch;
- uint8* screenGrid = _grid->giveGrid(cpt->screen) - 4;
- // ^^ this is actually a pointer to the last dword of the grid
+ uint8* screenGrid = _grid->giveGrid(cpt->screen);
+ screenGrid += GRID_SIZE-4; // all arrays are processed from behind, so make
+ // screenGrid point to the last element of our grid.
+
uint16 *routeCalc = _routeGrid + (ROUTE_GRID_SIZE >> 1) - 1;
uint8 stretch1, stretch2; // bl / bh
diff --git a/sky/grid.cpp b/sky/grid.cpp
index 998f8b1685..15e9f5670b 100644
--- a/sky/grid.cpp
+++ b/sky/grid.cpp
@@ -26,6 +26,7 @@
int8 SkyGrid::_gridConvertTable[] = {
+ 0, //0
1, //1
2, //2
3, //3