summaryrefslogtreecommitdiffstats
path: root/src/control/RoadBlocks.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-05-05 18:06:38 +0200
committeraap <aap@papnet.eu>2020-05-05 18:06:38 +0200
commite81652c2fc2787fc8aab3937be62127e7a3354ee (patch)
treec36897c90f4f37796ec955c49e70e99944de7dda /src/control/RoadBlocks.cpp
parentMerge pull request #514 from Nick007J/miami (diff)
downloadre3-e81652c2fc2787fc8aab3937be62127e7a3354ee.tar
re3-e81652c2fc2787fc8aab3937be62127e7a3354ee.tar.gz
re3-e81652c2fc2787fc8aab3937be62127e7a3354ee.tar.bz2
re3-e81652c2fc2787fc8aab3937be62127e7a3354ee.tar.lz
re3-e81652c2fc2787fc8aab3937be62127e7a3354ee.tar.xz
re3-e81652c2fc2787fc8aab3937be62127e7a3354ee.tar.zst
re3-e81652c2fc2787fc8aab3937be62127e7a3354ee.zip
Diffstat (limited to 'src/control/RoadBlocks.cpp')
-rw-r--r--src/control/RoadBlocks.cpp29
1 files changed, 5 insertions, 24 deletions
diff --git a/src/control/RoadBlocks.cpp b/src/control/RoadBlocks.cpp
index 322cc1df..3a271170 100644
--- a/src/control/RoadBlocks.cpp
+++ b/src/control/RoadBlocks.cpp
@@ -15,40 +15,23 @@
#include "CarCtrl.h"
#include "General.h"
-#ifndef MIAMI
-#define ROADBLOCKDIST (80.0f)
-#else
#define ROADBLOCKDIST (90.0f)
-#endif
int16 CRoadBlocks::NumRoadBlocks;
-#ifndef MIAMI
-int16 CRoadBlocks::RoadBlockObjects[NUMROADBLOCKS];
-#else
int16 CRoadBlocks::RoadBlockNodes[NUMROADBLOCKS];
-#endif
bool CRoadBlocks::InOrOut[NUMROADBLOCKS];
-//--MIAMI: TODO: script roadblocks
+//--MIAMI: TODO
void
CRoadBlocks::Init(void)
{
int i;
NumRoadBlocks = 0;
-#ifndef MIAMI
- for (i = 0; i < ThePaths.m_numMapObjects; i++) {
- if (ThePaths.m_objectFlags[i] & UseInRoadBlock) {
-#else
for(i = 0; i < ThePaths.m_numCarPathNodes; i++){
if(ThePaths.m_pathNodes[i].bUseInRoadBlock && ThePaths.m_pathNodes[i].numLinks == 2){
-#endif
if (NumRoadBlocks < NUMROADBLOCKS) {
InOrOut[NumRoadBlocks] = true;
-#ifndef MIAMI
- RoadBlockObjects[NumRoadBlocks] = i;
-#else
RoadBlockNodes[NumRoadBlocks] = i;
-#endif
NumRoadBlocks++;
} else {
#ifndef MASTER
@@ -59,6 +42,8 @@ CRoadBlocks::Init(void)
}
}
}
+
+ // TODO(MIAMI): script roadblocks
}
void
@@ -120,6 +105,7 @@ CRoadBlocks::GenerateRoadBlockCopsForCar(CVehicle* pVehicle, int32 roadBlockType
}
}
+//--MIAMI: TODO: implement this
void
CRoadBlocks::GenerateRoadBlocks(void)
{
@@ -128,12 +114,7 @@ CRoadBlocks::GenerateRoadBlocks(void)
int16 nRoadblockNode = (int16)(NUMROADBLOCKS * frame) / 16;
const int16 maxRoadBlocks = (int16)(NUMROADBLOCKS * (frame + 1)) / 16;
for (; nRoadblockNode < Min(NumRoadBlocks, maxRoadBlocks); nRoadblockNode++) {
-#ifndef MIAMI
- CTreadable *mapObject = ThePaths.m_mapObjects[RoadBlockObjects[nRoadblockNode]];
- CVector2D vecDistance = FindPlayerCoors() - mapObject->GetPosition();
-#else
CVector2D vecDistance = FindPlayerCoors() - ThePaths.m_pathNodes[nRoadblockNode].GetPosition();
-#endif
if (vecDistance.x > -ROADBLOCKDIST && vecDistance.x < ROADBLOCKDIST &&
vecDistance.y > -ROADBLOCKDIST && vecDistance.y < ROADBLOCKDIST &&
vecDistance.Magnitude() < ROADBLOCKDIST) {
@@ -218,5 +199,5 @@ CRoadBlocks::GenerateRoadBlocks(void)
}
}
-//--MIAMI: TODO script roadblocks
+ // TODO(MIAMI): script roadblocks
}