# HG changeset patch # User Nomad # Date 1364195862 -7200 # Node ID 290afbd48b6b34faedbfe9d6a5c6dbb2ca397958 # Parent 41b4e9769863281a1d6503d48adcfcf471e26418 IndoorLocation::GetSector fixed (even better!) diff -r 41b4e9769863 -r 290afbd48b6b Indoor.cpp --- a/Indoor.cpp Mon Mar 25 07:32:38 2013 +0200 +++ b/Indoor.cpp Mon Mar 25 09:17:42 2013 +0200 @@ -3196,7 +3196,7 @@ v54 = 0; v50 = pVertices[pFace->pVertexIDs[0]].y >= sY; - for (uint k = 1; k < pFace->uNumVertices; k++) + for (uint k = 1; k <= pFace->uNumVertices; k++) { v59 = v50; @@ -3206,7 +3206,7 @@ auto v2 = &pVertices[pFace->pVertexIDs[k]]; v50 = v2->y >= sY; - if ( v59 == v50 ) + if (v59 == v50) continue; auto v1 = &pVertices[pFace->pVertexIDs[k - 1]]; @@ -3232,8 +3232,8 @@ //_a58 = v33 / (v1->y - v2->y); //_a59 = fixpoint_mul(_a58, sY - v2->y); auto x_div_y = fixpoint_div(v1->x - v2->x, v1->y - v2->y); - auto rval = fixpoint_mul(x_div_y, sY - v2->y); // a / b * c - looks like projection - if (rval + v2->x > sX) + auto res = fixpoint_mul(x_div_y, sY - v2->y); // a / b * c - looks like projection + if (res + v2->x > sX) ++v54; } else