From 648add8aa88566fa1d8a2d616c7177f562aef8d8 Mon Sep 17 00:00:00 2001 From: Oliver Kiehl Date: Sun, 27 Apr 2003 16:36:24 +0000 Subject: [PATCH] fix mistake I did earlier svn-id: r7160 --- sky/autoroute.cpp | 5 +++-- sky/autoroute.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sky/autoroute.cpp b/sky/autoroute.cpp index cc62df7d78b..5a3196995f8 100644 --- a/sky/autoroute.cpp +++ b/sky/autoroute.cpp @@ -52,14 +52,14 @@ uint16 SkyAutoRoute::checkBlock(uint16 *blockPos) { return retVal; } -uint16 SkyAutoRoute::autoRoute(Compact *cpt, uint16 *routeCalc) { +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 - routeCalc = _routeGrid + (ROUTE_GRID_SIZE >> 1) - 1; + uint16 *routeCalc = _routeGrid + (ROUTE_GRID_SIZE >> 1) - 1; uint8 stretch1, stretch2; // bl / bh stretch1 = 0; @@ -342,6 +342,7 @@ uint16 SkyAutoRoute::autoRoute(Compact *cpt, uint16 *routeCalc) { // I wonder why initY isn't checked // saveRoute should now point to routeData if (routeData > saveRoute) error("Autoroute: Internal pointer error! routeData overflow."); + *pSaveRoute = saveRoute; return 1; } diff --git a/sky/autoroute.h b/sky/autoroute.h index 00e4baa230c..8663b6af979 100644 --- a/sky/autoroute.h +++ b/sky/autoroute.h @@ -36,7 +36,7 @@ class SkyAutoRoute { public: SkyAutoRoute(SkyGrid *pGrid); ~SkyAutoRoute(void); - uint16 autoRoute(Compact *cpt, uint16 *routeCalc); + uint16 autoRoute(Compact *cpt, uint16 **pSaveRoute); private: uint16 checkBlock(uint16 *blockPos); SkyGrid *_grid;