diff options
author | saml1er <danishroar@gmail.com> | 2020-04-14 20:32:15 +0200 |
---|---|---|
committer | saml1er <danishroar@gmail.com> | 2020-04-14 20:32:15 +0200 |
commit | 6d5464b6bbf44481a56682c9a3fe8d22baf8282e (patch) | |
tree | 2d975bf1027021ccef922b3774cdcaf7d46bac8c /src/control | |
parent | Remove float casts (diff) | |
download | re3-6d5464b6bbf44481a56682c9a3fe8d22baf8282e.tar re3-6d5464b6bbf44481a56682c9a3fe8d22baf8282e.tar.gz re3-6d5464b6bbf44481a56682c9a3fe8d22baf8282e.tar.bz2 re3-6d5464b6bbf44481a56682c9a3fe8d22baf8282e.tar.lz re3-6d5464b6bbf44481a56682c9a3fe8d22baf8282e.tar.xz re3-6d5464b6bbf44481a56682c9a3fe8d22baf8282e.tar.zst re3-6d5464b6bbf44481a56682c9a3fe8d22baf8282e.zip |
Diffstat (limited to 'src/control')
-rw-r--r-- | src/control/PathFind.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/control/PathFind.cpp b/src/control/PathFind.cpp index ea81b9b7..9f45c454 100644 --- a/src/control/PathFind.cpp +++ b/src/control/PathFind.cpp @@ -15,6 +15,7 @@ bool gbShowCarPathsLinks; CPathFind &ThePaths = *(CPathFind*)0x8F6754; #define MAX_DIST INT16_MAX-1 +#define MIN_PED_ROUTE_DISTANCE 23.8f // object flags: // 1 UseInRoadBlock @@ -31,7 +32,7 @@ CPedPath::CalcPedRoute(int8 pathType, CVector position, CVector destination, CVe { *pointsFound = 0; CVector vecDistance = destination - position; - if (Abs(vecDistance.x) > 23.8f || Abs(vecDistance.y) > 23.8f || Abs(vecDistance.z) > 23.8f) + if (Abs(vecDistance.x) > MIN_PED_ROUTE_DISTANCE || Abs(vecDistance.y) > MIN_PED_ROUTE_DISTANCE || Abs(vecDistance.z) > MIN_PED_ROUTE_DISTANCE) return false; CVector vecPos = (position + destination) * 0.5f; CVector vecSectorStartPos (vecPos.x - 14.0f, vecPos.y - 14.0f, vecPos.z); @@ -47,7 +48,7 @@ CPedPath::CalcPedRoute(int8 pathType, CVector position, CVector destination, CVe for (int32 x = 0; x < 40; x++) { for (int32 y = 0; y < 40; y++) { pathNodes[x][y].bBlockade = false; - pathNodes[x][y].id = 0x7FFF; + pathNodes[x][y].id = INT16_MAX; pathNodes[x][y].nodeIdX = x; pathNodes[x][y].nodeIdY = y; } @@ -147,7 +148,7 @@ void CPedPath::AddNodeToPathList(CPedPathNode *pNodeToAdd, int16 id, CPedPathNode *pNodeList) { if (!pNodeToAdd->bBlockade && id < pNodeToAdd->id) { - if (pNodeToAdd->id != 0x7FFF) + if (pNodeToAdd->id != INT16_MAX) RemoveNodeFromList(pNodeToAdd); AddNodeToList(pNodeToAdd, id, pNodeList); } |