summaryrefslogtreecommitdiffstats
path: root/src/control/PathFind.cpp
diff options
context:
space:
mode:
authorFire_Head <Fire-Head@users.noreply.github.com>2020-06-29 08:37:53 +0200
committerGitHub <noreply@github.com>2020-06-29 08:37:53 +0200
commit860f75d66ce51f2f5f3ea2b4b2b582f6d161a2bb (patch)
tree6a8f83b0d46e97b198f095b7624deecca75051e7 /src/control/PathFind.cpp
parentrestore Text.cpp (diff)
parentMerge remote-tracking branch 'upstream/master' (diff)
downloadre3-860f75d66ce51f2f5f3ea2b4b2b582f6d161a2bb.tar
re3-860f75d66ce51f2f5f3ea2b4b2b582f6d161a2bb.tar.gz
re3-860f75d66ce51f2f5f3ea2b4b2b582f6d161a2bb.tar.bz2
re3-860f75d66ce51f2f5f3ea2b4b2b582f6d161a2bb.tar.lz
re3-860f75d66ce51f2f5f3ea2b4b2b582f6d161a2bb.tar.xz
re3-860f75d66ce51f2f5f3ea2b4b2b582f6d161a2bb.tar.zst
re3-860f75d66ce51f2f5f3ea2b4b2b582f6d161a2bb.zip
Diffstat (limited to 'src/control/PathFind.cpp')
-rw-r--r--src/control/PathFind.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/control/PathFind.cpp b/src/control/PathFind.cpp
index ee15b82f..46895678 100644
--- a/src/control/PathFind.cpp
+++ b/src/control/PathFind.cpp
@@ -404,11 +404,10 @@ CPathFind::PreparePathData(void)
maxX = 0.0f;
maxY = 0.0f;
for(j = 0; j < 12; j++){
- k = i*12 + j;
+ k = m_mapObjects[i]->GetModelIndex()*12 + j;
if(InfoForTileCars[k].type == NodeTypeExtern){
numExtern++;
- if(InfoForTileCars[k].numLeftLanes + InfoForTileCars[k].numRightLanes > numLanes)
- numLanes = InfoForTileCars[k].numLeftLanes + InfoForTileCars[k].numRightLanes;
+ numLanes = Max(numLanes, InfoForTileCars[k].numLeftLanes + InfoForTileCars[k].numRightLanes);
maxX = Max(maxX, Abs(InfoForTileCars[k].x));
maxY = Max(maxY, Abs(InfoForTileCars[k].y));
}else if(InfoForTileCars[k].type == NodeTypeIntern)
@@ -417,7 +416,7 @@ CPathFind::PreparePathData(void)
if(numIntern == 1 && numExtern == 2){
if(numLanes < 4){
- if((i & 7) == 4){ // WHAT?
+ if((i & 7) == 4){ // 1/8 probability
m_objectFlags[i] |= UseInRoadBlock;
if(maxX > maxY)
m_objectFlags[i] |= ObjectEastWest;