summaryrefslogtreecommitdiffstats
path: root/src/control
diff options
context:
space:
mode:
authorFilip Gawin <filip.gawin@zoho.com>2020-04-17 19:30:57 +0200
committerFilip Gawin <filip.gawin@zoho.com>2020-04-17 19:30:57 +0200
commit63951d9b957b30a110f42a03edb4833cbbaf380e (patch)
tree8402ea533b91a216a1dfecd865d6d86a443bc74f /src/control
parentUpdate README.md (diff)
downloadre3-63951d9b957b30a110f42a03edb4833cbbaf380e.tar
re3-63951d9b957b30a110f42a03edb4833cbbaf380e.tar.gz
re3-63951d9b957b30a110f42a03edb4833cbbaf380e.tar.bz2
re3-63951d9b957b30a110f42a03edb4833cbbaf380e.tar.lz
re3-63951d9b957b30a110f42a03edb4833cbbaf380e.tar.xz
re3-63951d9b957b30a110f42a03edb4833cbbaf380e.tar.zst
re3-63951d9b957b30a110f42a03edb4833cbbaf380e.zip
Diffstat (limited to 'src/control')
-rw-r--r--src/control/Darkel.h3
-rw-r--r--src/control/PathFind.cpp35
-rw-r--r--src/control/TrafficLights.cpp2
3 files changed, 24 insertions, 16 deletions
diff --git a/src/control/Darkel.h b/src/control/Darkel.h
index b6092dcb..14529c63 100644
--- a/src/control/Darkel.h
+++ b/src/control/Darkel.h
@@ -1,9 +1,10 @@
#pragma once
+
#include "ModelIndices.h"
+#include "WeaponType.h"
class CVehicle;
class CPed;
-enum eWeaponType;
enum
{
diff --git a/src/control/PathFind.cpp b/src/control/PathFind.cpp
index 9d0959a8..cedef63c 100644
--- a/src/control/PathFind.cpp
+++ b/src/control/PathFind.cpp
@@ -1466,8 +1466,11 @@ CPathFind::DoPathSearch(uint8 type, CVector start, int32 startNodeId, CVector ta
targetNode = FindNodeClosestToCoors(target, type, distLimit);
else
targetNode = forcedTargetNode;
- if(targetNode < 0)
- goto fail;
+ if(targetNode < 0) {
+ *pNumNodes = 0;
+ if(pDist) *pDist = 100000.0f;
+ return;
+ }
// Find start
int numPathsToTry;
@@ -1486,19 +1489,28 @@ CPathFind::DoPathSearch(uint8 type, CVector start, int32 startNodeId, CVector ta
numPathsToTry = 1;
startObj = m_mapObjects[m_pathNodes[startNodeId].objectIndex];
}
- if(numPathsToTry == 0)
- goto fail;
+ if(numPathsToTry == 0) {
+ *pNumNodes = 0;
+ if(pDist) *pDist = 100000.0f;
+ return;
+ }
if(startNodeId < 0){
// why only check node 0?
- if(m_pathNodes[startObj->m_nodeIndices[type][0]].group != m_pathNodes[targetNode].group)
- goto fail;
+ if(m_pathNodes[startObj->m_nodeIndices[type][0]].group !=
+ m_pathNodes[targetNode].group) {
+ *pNumNodes = 0;
+ if(pDist) *pDist = 100000.0f;
+ return;
+ }
}else{
- if(m_pathNodes[startNodeId].group != m_pathNodes[targetNode].group)
- goto fail;
+ if(m_pathNodes[startNodeId].group != m_pathNodes[targetNode].group) {
+ *pNumNodes = 0;
+ if(pDist) *pDist = 100000.0f;
+ return;
+ }
}
-
for(i = 0; i < 512; i++)
m_searchNodes[i].next = nil;
AddNodeToList(&m_pathNodes[targetNode], 0);
@@ -1576,11 +1588,6 @@ CPathFind::DoPathSearch(uint8 type, CVector start, int32 startNodeId, CVector ta
for(i = 0; i < numNodesToBeCleared; i++)
apNodesToBeCleared[i]->distance = MAX_DIST;
return;
-
-fail:
- *pNumNodes = 0;
- if(pDist)
- *pDist = 100000.0f;
}
static CPathNode *pNodeList[32];
diff --git a/src/control/TrafficLights.cpp b/src/control/TrafficLights.cpp
index 096bb484..70fcbc32 100644
--- a/src/control/TrafficLights.cpp
+++ b/src/control/TrafficLights.cpp
@@ -8,7 +8,7 @@
#include "Clock.h"
#include "Weather.h"
#include "Timecycle.h"
-#include "Pointlights.h"
+#include "PointLights.h"
#include "Shadows.h"
#include "Coronas.h"
#include "SpecialFX.h"