From f01a402694dcd6934b4dee3b936f1b9dd1d2978b Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sun, 25 May 2014 23:29:03 +0200 Subject: TOUCHE: Reduce the scope of a variable --- engines/touche/touche.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/touche') diff --git a/engines/touche/touche.cpp b/engines/touche/touche.cpp index 7b70b4a9ee..ff4f41f44d 100644 --- a/engines/touche/touche.cpp +++ b/engines/touche/touche.cpp @@ -3114,12 +3114,12 @@ void ToucheEngine::buildWalkPath(int dstPosX, int dstPosY, int keyChar) { for (uint i = 0; i < _programWalkTable.size(); ++i) { const ProgramWalkData *pwd = &_programWalkTable[i]; if ((pwd->point1 & 0x4000) == 0) { - int distance = 32000; ProgramPointData *pts1 = &_programPointsTable[pwd->point1]; ProgramPointData *pts2 = &_programPointsTable[pwd->point2]; if (pts1->order != 0) { int dx = pts2->x - pts1->x; int dy = pts2->y - pts1->y; + int distance = 32000; if (dx == 0) { if (dstPosY > MIN(pts2->y, pts1->y) && dstPosY < MAX(pts2->y, pts1->y)) { int d = ABS(dstPosX - pts1->x); -- cgit v1.2.3