More PathFind fixes

This commit is contained in:
Sergeanur 2019-10-14 22:58:22 +03:00
parent 9d2b7a99b3
commit 5c36eae89f
1 changed files with 6 additions and 5 deletions

View File

@ -794,7 +794,7 @@ CPathFind::SwitchRoadsOffInArea(float x1, float x2, float y1, float y2, float z1
{ {
int i; 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 && 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 && y1 <= m_pathNodes[i].pos.y && m_pathNodes[i].pos.y <= y2 &&
z1 <= m_pathNodes[i].pos.z && m_pathNodes[i].pos.z <= z2 && 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 i;
int firstNode, lastNode; int firstNode, lastNode;
if(type == PATH_CAR){ // this is NOT PATH_CAR
if(type != 0){
firstNode = 0; firstNode = 0;
lastNode = m_numCarPathNodes; lastNode = m_numCarPathNodes;
}else{ }else{
@ -830,9 +831,9 @@ CPathFind::SwitchRoadsInAngledArea(float x1, float y1, float z1, float x2, float
} }
if(z1 > z2){ if(z1 > z2){
float tmp = z1; float tmp = z2;
z1 = z2; z2 = z1;
z2 = tmp; z1 = tmp;
} }
// angle of vector from p2 to p1 // angle of vector from p2 to p1