diff options
author | aap <aap@papnet.eu> | 2019-06-17 10:30:02 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2019-06-17 22:40:15 +0200 |
commit | b5fba778c4a307f0a5721c9b3b0efb38be96634b (patch) | |
tree | 9fe0738d1d6dcf4677aac12e1efadff18887f7b4 /src/control/PathFind.cpp | |
parent | Merge pull request #20 from gennariarmando/master (diff) | |
download | re3-b5fba778c4a307f0a5721c9b3b0efb38be96634b.tar re3-b5fba778c4a307f0a5721c9b3b0efb38be96634b.tar.gz re3-b5fba778c4a307f0a5721c9b3b0efb38be96634b.tar.bz2 re3-b5fba778c4a307f0a5721c9b3b0efb38be96634b.tar.lz re3-b5fba778c4a307f0a5721c9b3b0efb38be96634b.tar.xz re3-b5fba778c4a307f0a5721c9b3b0efb38be96634b.tar.zst re3-b5fba778c4a307f0a5721c9b3b0efb38be96634b.zip |
Diffstat (limited to 'src/control/PathFind.cpp')
-rw-r--r-- | src/control/PathFind.cpp | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/src/control/PathFind.cpp b/src/control/PathFind.cpp index 8857f8c9..8cfc17e7 100644 --- a/src/control/PathFind.cpp +++ b/src/control/PathFind.cpp @@ -46,6 +46,37 @@ 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::PreparePathData(void) { int i, j, k; @@ -457,8 +488,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; |