diff options
author | aap <aap@papnet.eu> | 2020-05-08 11:04:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-08 11:04:00 +0200 |
commit | 2171ebe2dae896303b2da9716630096ba3921673 (patch) | |
tree | 70be3e22307bc947702b0d12c7fc5fb802c3f1ef /src/control/PathFind.cpp | |
parent | Merge remote-tracking branch 'origin/master' into miami (diff) | |
parent | final fix (diff) | |
download | re3-2171ebe2dae896303b2da9716630096ba3921673.tar re3-2171ebe2dae896303b2da9716630096ba3921673.tar.gz re3-2171ebe2dae896303b2da9716630096ba3921673.tar.bz2 re3-2171ebe2dae896303b2da9716630096ba3921673.tar.lz re3-2171ebe2dae896303b2da9716630096ba3921673.tar.xz re3-2171ebe2dae896303b2da9716630096ba3921673.tar.zst re3-2171ebe2dae896303b2da9716630096ba3921673.zip |
Diffstat (limited to 'src/control/PathFind.cpp')
-rw-r--r-- | src/control/PathFind.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/control/PathFind.cpp b/src/control/PathFind.cpp index 08eadb25..20c4aa69 100644 --- a/src/control/PathFind.cpp +++ b/src/control/PathFind.cpp @@ -1419,14 +1419,14 @@ CPathFind::NewGenerateCarCreationCoors(float x, float y, float dirX, float dirY, if(m_pathNodes[node1].bDisabled && !ignoreDisabled) continue; dist1 = Distance2D(m_pathNodes[node1].GetPosition(), x, y); - if(dist1 < spawnDist + 60.0f){ - d1 = dist1 - spawnDist; + if(dist1 < Max(spawnDist + 70.0f, spawnDist * 1.7f)){ + d1 = m_pathNodes[node1].bWaterPath ? (dist1 - spawnDist * 1.5f) : (dist1 - spawnDist); for(j = 0; j < m_pathNodes[node1].numLinks; j++){ node2 = ConnectedNode(m_pathNodes[node1].firstLink + j); if(m_pathNodes[node2].bDisabled && !ignoreDisabled) continue; dist2 = Distance2D(m_pathNodes[node2].GetPosition(), x, y); - d2 = dist2 - spawnDist; + d2 = m_pathNodes[node2].bWaterPath ? (dist2 - spawnDist * 1.5f) : (dist2 - spawnDist); if(d1*d2 < 0.0f){ // nodes are on different sides of spawn distance float f2 = Abs(d1)/(Abs(d1) + Abs(d2)); |