summaryrefslogtreecommitdiffstats
path: root/src/control/PathFind.cpp
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2019-06-18 14:34:35 +0200
committereray orçunus <erayorcunus@gmail.com>2019-06-18 14:34:35 +0200
commit886db44936757c4ace710b40713fbae1aa575c45 (patch)
treeaf3622689fedeac10516cfdcf5f3d1f0471746b6 /src/control/PathFind.cpp
parentCPed fixes (diff)
parentsilly mistake in CFileLoader (diff)
downloadre3-886db44936757c4ace710b40713fbae1aa575c45.tar
re3-886db44936757c4ace710b40713fbae1aa575c45.tar.gz
re3-886db44936757c4ace710b40713fbae1aa575c45.tar.bz2
re3-886db44936757c4ace710b40713fbae1aa575c45.tar.lz
re3-886db44936757c4ace710b40713fbae1aa575c45.tar.xz
re3-886db44936757c4ace710b40713fbae1aa575c45.tar.zst
re3-886db44936757c4ace710b40713fbae1aa575c45.zip
Diffstat (limited to 'src/control/PathFind.cpp')
-rw-r--r--src/control/PathFind.cpp41
1 files changed, 39 insertions, 2 deletions
diff --git a/src/control/PathFind.cpp b/src/control/PathFind.cpp
index 8857f8c9..c3af2e30 100644
--- a/src/control/PathFind.cpp
+++ b/src/control/PathFind.cpp
@@ -46,6 +46,43 @@ CTempDetachedNode *&DetachedNodesCars = *(CTempDetachedNode**)0x8E2824;
CTempDetachedNode *&DetachedNodesPeds = *(CTempDetachedNode**)0x8E28A0;
void
+CPathFind::StoreNodeInfoPed(int16 id, int16 node, int8 type, int8 next, int16 x, int16 y, int16 z, int16 width, bool crossing)
+{
+ int i;
+
+ i = id*12 + node;
+ InfoForTilePeds[i].type = type;
+ InfoForTilePeds[i].next = next;
+ InfoForTilePeds[i].x = x;
+ InfoForTilePeds[i].y = y;
+ InfoForTilePeds[i].z = z;
+ InfoForTilePeds[i].numLeftLanes = 0;
+ InfoForTilePeds[i].numRightLanes = 0;
+ InfoForTilePeds[i].crossing = crossing;
+}
+
+void
+CPathFind::StoreNodeInfoCar(int16 id, int16 node, int8 type, int8 next, int16 x, int16 y, int16 z, int16 width, int8 numLeft, int8 numRight)
+{
+ int i;
+
+ i = id*12 + node;
+ InfoForTileCars[i].type = type;
+ InfoForTileCars[i].next = next;
+ InfoForTileCars[i].x = x;
+ InfoForTileCars[i].y = y;
+ InfoForTileCars[i].z = z;
+ InfoForTileCars[i].numLeftLanes = numLeft;
+ InfoForTileCars[i].numRightLanes = numRight;
+}
+
+void
+CPathFind::RegisterMapObject(CTreadable *mapObject)
+{
+ m_mapObjects[m_numMapObjects++] = mapObject;
+}
+
+void
CPathFind::PreparePathData(void)
{
int i, j, k;
@@ -457,8 +494,8 @@ CPathFind::PreparePathDataForType(uint8 type, CTempNode *tempnodes, CPathInfoFor
}
}else{
// Crosses road
- if(objectpathinfo[istart + iseg].next == jseg && objectpathinfo[istart + iseg].flag & 1 ||
- objectpathinfo[jstart + jseg].next == iseg && objectpathinfo[jstart + jseg].flag & 1)
+ if(objectpathinfo[istart + iseg].next == jseg && objectpathinfo[istart + iseg].crossing ||
+ objectpathinfo[jstart + jseg].next == iseg && objectpathinfo[jstart + jseg].crossing)
m_connectionFlags[m_numConnections] |= ConnectionCrossRoad;
else
m_connectionFlags[m_numConnections] &= ~ConnectionCrossRoad;