diff options
author | Nicola Mettifogo | 2007-03-21 19:42:09 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-03-21 19:42:09 +0000 |
commit | 89ea1f3abf2281d1f8786c1eb5cce31c7d5404e0 (patch) | |
tree | a4b3f8321e957c0ddfb5aa6d11d1b42bc2c5f3aa /engines | |
parent | 7a816395155508479ed597013c4b9bb0b6e0430f (diff) | |
download | scummvm-rg350-89ea1f3abf2281d1f8786c1eb5cce31c7d5404e0.tar.gz scummvm-rg350-89ea1f3abf2281d1f8786c1eb5cce31c7d5404e0.tar.bz2 scummvm-rg350-89ea1f3abf2281d1f8786c1eb5cce31c7d5404e0.zip |
got rid of cryptic pseudo-boolean variable in buildWalkPath
svn-id: r26269
Diffstat (limited to 'engines')
-rw-r--r-- | engines/parallaction/walk.cpp | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/engines/parallaction/walk.cpp b/engines/parallaction/walk.cpp index 0042210e85..11fd9720a4 100644 --- a/engines/parallaction/walk.cpp +++ b/engines/parallaction/walk.cpp @@ -143,7 +143,6 @@ WalkNode *buildWalkPath(uint16 x, uint16 y) { Common::Point pos(_vm->_char._ani._left, _vm->_char._ani._top); - byte _closest_node_found = 1; bool emptyList = true; Common::Point v8; @@ -156,9 +155,9 @@ WalkNode *buildWalkPath(uint16 x, uint16 y) { v34 = v30 = pos.sqrDist(stop); // square distance from current position and target - while (_closest_node_found != 0) { + while (true) { - _closest_node_found = 0; + _closest_node = NULL; WalkNode *location_node = (WalkNode*)_vm->_location._walkNodes._next; // scans location path nodes searching for the nearest Node @@ -171,7 +170,6 @@ WalkNode *buildWalkPath(uint16 x, uint16 y) { v28 = v8.sqrDist(v20); if (v2C < v34 && v28 < v30) { - _closest_node_found = 1; v30 = v28; _closest_node = location_node; } @@ -179,7 +177,7 @@ WalkNode *buildWalkPath(uint16 x, uint16 y) { location_node = (WalkNode*)location_node->_next; } - if (_closest_node_found == 0) break; + if (_closest_node == NULL) break; WalkNode *_newnode = new WalkNode(*_closest_node); _newnode->getPoint(v20); @@ -199,25 +197,15 @@ WalkNode *buildWalkPath(uint16 x, uint16 y) { freeNodeList(v58._next); debugC(1, kDebugWalk, "can't find a path node: rejecting partial path"); return v44; - } else { - ((WalkNode*)(v58._next))->getPoint(stop); - emptyList = false; - _closest_node_found = 1; } + ((WalkNode*)(v58._next))->getPoint(stop); + emptyList = false; + } while (true); debugC(1, kDebugWalk, "walk path completed"); - WalkNode* tmp = &v58; - uint16 i = 1; - while (tmp->_next) { - debugC(1, kDebugWalk, "node %i: %i, %i", i, tmp->_x, tmp->_y); - tmp = (WalkNode*)tmp->_next; - i++; - } - - delete v44; return (WalkNode*)v58._next; } |