From ebbcd92de28d37f1dd36c9120f92c958e394ff75 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Sat, 3 Aug 2019 16:01:13 +0300 Subject: RunningScript, part 4, plus some fixes --- src/entities/Physical.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/entities') diff --git a/src/entities/Physical.cpp b/src/entities/Physical.cpp index 55ed5380..391f1e33 100644 --- a/src/entities/Physical.cpp +++ b/src/entities/Physical.cpp @@ -62,7 +62,7 @@ CPhysical::CPhysical(void) m_phy_flagA10 = false; m_phy_flagA20 = false; - m_nSurfaceTouched = SURFACE_DEFAULT; + m_nZoneLevel = 0; } CPhysical::~CPhysical(void) -- cgit v1.2.3 From 4ae4bc94c692d9fe5781d36a7be6ab72803f6162 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Wed, 7 Aug 2019 00:32:19 +0300 Subject: CCarCtrl::GenerateOneRandomVehicle! --- src/entities/Physical.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/entities') diff --git a/src/entities/Physical.h b/src/entities/Physical.h index 26ef0086..ee75d059 100644 --- a/src/entities/Physical.h +++ b/src/entities/Physical.h @@ -115,6 +115,9 @@ public: m_vecMoveSpeed.y = y; m_vecMoveSpeed.z = z; } + void SetMoveSpeed(const CVector& speed) { + m_vecMoveSpeed = speed; + } const CVector &GetTurnSpeed() { return m_vecTurnSpeed; } void SetTurnSpeed(float x, float y, float z) { m_vecTurnSpeed.x = x; -- cgit v1.2.3 From 0bd681abc514d5a3627edea40b24347696ac8908 Mon Sep 17 00:00:00 2001 From: aap Date: Fri, 9 Aug 2019 19:42:18 +0200 Subject: finished CPathFind --- src/entities/Physical.cpp | 25 +++++++++++++------------ src/entities/Physical.h | 3 +-- src/entities/Treadable.h | 3 +-- 3 files changed, 15 insertions(+), 16 deletions(-) (limited to 'src/entities') diff --git a/src/entities/Physical.cpp b/src/entities/Physical.cpp index 391f1e33..fbd1322d 100644 --- a/src/entities/Physical.cpp +++ b/src/entities/Physical.cpp @@ -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; } } diff --git a/src/entities/Physical.h b/src/entities/Physical.h index ee75d059..2786a7de 100644 --- a/src/entities/Physical.h +++ b/src/entities/Physical.h @@ -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 diff --git a/src/entities/Treadable.h b/src/entities/Treadable.h index d82ff52b..9e4de59a 100644 --- a/src/entities/Treadable.h +++ b/src/entities/Treadable.h @@ -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; } }; -- cgit v1.2.3