summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2019-10-14 21:58:22 +0200
committerSergeanur <s.anureev@yandex.ua>2019-10-14 21:58:22 +0200
commit5c36eae89f6b256badbe8ff665bec1660220d453 (patch)
tree68a3edd40c18f7e43dc5825fc85074c77149f0e0
parentSome PathFind fixes (not all) (diff)
downloadre3-5c36eae89f6b256badbe8ff665bec1660220d453.tar
re3-5c36eae89f6b256badbe8ff665bec1660220d453.tar.gz
re3-5c36eae89f6b256badbe8ff665bec1660220d453.tar.bz2
re3-5c36eae89f6b256badbe8ff665bec1660220d453.tar.lz
re3-5c36eae89f6b256badbe8ff665bec1660220d453.tar.xz
re3-5c36eae89f6b256badbe8ff665bec1660220d453.tar.zst
re3-5c36eae89f6b256badbe8ff665bec1660220d453.zip
-rw-r--r--src/control/PathFind.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/control/PathFind.cpp b/src/control/PathFind.cpp
index 1d19cfc3..3c16202b 100644
--- a/src/control/PathFind.cpp
+++ b/src/control/PathFind.cpp
@@ -794,7 +794,7 @@ CPathFind::SwitchRoadsOffInArea(float x1, float x2, float y1, float y2, float z1
{
int i;
- for(i = 0; i < m_numPathNodes; i++)
+ for(i = 0; i < m_numCarPathNodes; i++)
if (x1 <= m_pathNodes[i].pos.x && m_pathNodes[i].pos.x <= x2 &&
y1 <= m_pathNodes[i].pos.y && m_pathNodes[i].pos.y <= y2 &&
z1 <= m_pathNodes[i].pos.z && m_pathNodes[i].pos.z <= z2 &&
@@ -821,7 +821,8 @@ CPathFind::SwitchRoadsInAngledArea(float x1, float y1, float z1, float x2, float
int i;
int firstNode, lastNode;
- if(type == PATH_CAR){
+ // this is NOT PATH_CAR
+ if(type != 0){
firstNode = 0;
lastNode = m_numCarPathNodes;
}else{
@@ -830,9 +831,9 @@ CPathFind::SwitchRoadsInAngledArea(float x1, float y1, float z1, float x2, float
}
if(z1 > z2){
- float tmp = z1;
- z1 = z2;
- z2 = tmp;
+ float tmp = z2;
+ z2 = z1;
+ z1 = tmp;
}
// angle of vector from p2 to p1