finished CPathFind

This commit is contained in:
aap
2019-08-09 19:42:18 +02:00
parent 5f01f6c634
commit 0bd681abc5
10 changed files with 1058 additions and 135 deletions

View File

@ -11,6 +11,7 @@
#include "ParticleObject.h"
#include "Particle.h"
#include "SurfaceTable.h"
#include "PathFind.h"
#include "CarCtrl.h"
#include "DMAudio.h"
#include "Automobile.h"
@ -56,8 +57,8 @@ CPhysical::CPhysical(void)
m_phy_flagA80 = false;
m_fDistanceTravelled = 0.0f;
m_pedTreadable = nil;
m_carTreadable = nil;
m_treadable[PATH_CAR] = nil;
m_treadable[PATH_PED] = nil;
m_phy_flagA10 = false;
m_phy_flagA20 = false;
@ -267,16 +268,16 @@ CPhysical::AddCollisionRecord_Treadable(CEntity *ent)
{
if(ent->IsBuilding() && ((CBuilding*)ent)->GetIsATreadable()){
CTreadable *t = (CTreadable*)ent;
if(t->m_nodeIndicesPeds[0] >= 0 ||
t->m_nodeIndicesPeds[1] >= 0 ||
t->m_nodeIndicesPeds[2] >= 0 ||
t->m_nodeIndicesPeds[3] >= 0)
m_pedTreadable = t;
if(t->m_nodeIndicesCars[0] >= 0 ||
t->m_nodeIndicesCars[1] >= 0 ||
t->m_nodeIndicesCars[2] >= 0 ||
t->m_nodeIndicesCars[3] >= 0)
m_carTreadable = t;
if(t->m_nodeIndices[PATH_PED][0] >= 0 ||
t->m_nodeIndices[PATH_PED][1] >= 0 ||
t->m_nodeIndices[PATH_PED][2] >= 0 ||
t->m_nodeIndices[PATH_PED][3] >= 0)
m_treadable[PATH_PED] = t;
if(t->m_nodeIndices[PATH_CAR][0] >= 0 ||
t->m_nodeIndices[PATH_CAR][1] >= 0 ||
t->m_nodeIndices[PATH_CAR][2] >= 0 ||
t->m_nodeIndices[PATH_CAR][3] >= 0)
m_treadable[PATH_CAR] = t;
}
}

View File

@ -19,8 +19,7 @@ public:
int32 m_audioEntityId;
float unk1;
CTreadable *m_carTreadable;
CTreadable *m_pedTreadable;
CTreadable *m_treadable[2]; // car and ped
uint32 m_nLastTimeCollided;
CVector m_vecMoveSpeed; // velocity
CVector m_vecTurnSpeed; // angular velocity

View File

@ -8,8 +8,7 @@ public:
static void *operator new(size_t);
static void operator delete(void*, size_t);
int16 m_nodeIndicesCars[12];
int16 m_nodeIndicesPeds[12];
int16 m_nodeIndices[2][12]; // first car, then ped
bool GetIsATreadable(void) { return true; }
};