summaryrefslogtreecommitdiffstats
path: root/src/control/PathFind.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-05-07 15:57:49 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-05-07 15:57:49 +0200
commit40888e9486f00aa852c531209bbfe55f24e2e04f (patch)
tree830ce89f85d2e10386d5d697468eee5f5c9e07d7 /src/control/PathFind.cpp
parentchanged default ID ranges. old default.ide incompatible now (diff)
downloadre3-40888e9486f00aa852c531209bbfe55f24e2e04f.tar
re3-40888e9486f00aa852c531209bbfe55f24e2e04f.tar.gz
re3-40888e9486f00aa852c531209bbfe55f24e2e04f.tar.bz2
re3-40888e9486f00aa852c531209bbfe55f24e2e04f.tar.lz
re3-40888e9486f00aa852c531209bbfe55f24e2e04f.tar.xz
re3-40888e9486f00aa852c531209bbfe55f24e2e04f.tar.zst
re3-40888e9486f00aa852c531209bbfe55f24e2e04f.zip
Diffstat (limited to '')
-rw-r--r--src/control/PathFind.cpp6
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));