Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Merge pull request #203 from Nick007J/master
CCarCtrl pathfinding
  • Loading branch information
aap committed Sep 12, 2019
2 parents 3378cad + 426efa9 commit 7f81eb86a34ed62e4a6990dc88bb150de9dfeab7
@@ -2,4 +2,5 @@
#include "patcher.h"
#include "AutoPilot.h"

WRAPPER void CAutoPilot::RemoveOnePathNode() { EAXJMP(0x413A00); }
WRAPPER void CAutoPilot::ModifySpeed(float) { EAXJMP(0x4137B0); }
@@ -2,6 +2,7 @@
#include "Timer.h"

class CVehicle;
struct CPathNode;

enum eCarMission : uint8
{
@@ -60,9 +61,9 @@ enum eCarDrivingStyle : uint8

class CAutoPilot {
public:
uint32 m_nCurrentRouteNode;
uint32 m_nNextRouteNode;
uint32 m_nPrevRouteNode;
int32 m_nCurrentRouteNode;
int32 m_nNextRouteNode;
int32 m_nPrevRouteNode;
uint32 m_nTimeEnteredCurve;
uint32 m_nTimeToSpendOnCurrentCurve;
uint32 m_nCurrentPathNodeInfo;
@@ -83,12 +84,12 @@ class CAutoPilot {
uint8 m_nCruiseSpeed;
uint8 m_bSlowedDownBecauseOfCars : 1;
uint8 m_bSlowedDownBecauseOfPeds : 1;
uint8 m_flag4 : 1;
uint8 m_flag8 : 1;
uint8 m_bStayInCurrentLevel : 1;
uint8 m_bStayInFastLane : 1;
uint8 m_flag10 : 1;
CVector m_vecDestinationCoors;
void *m_aPathFindNodesInfo[8];
uint16 m_nPathFindNodesCount;
CPathNode *m_aPathFindNodesInfo[NUM_PATH_NODES_IN_AUTOPILOT];
int16 m_nPathFindNodesCount;
CVehicle *m_pTargetCar;

CAutoPilot(void) {
@@ -114,9 +115,10 @@ class CAutoPilot {
m_pTargetCar = 0;
m_nTimeToStartMission = CTimer::GetTimeInMilliseconds();
m_nAntiReverseTimer = m_nTimeToStartMission;
m_flag8 = false;
m_bStayInFastLane = false;
}

void ModifySpeed(float);
void RemoveOnePathNode();
};
static_assert(sizeof(CAutoPilot) == 0x70, "CAutoPilot: error");

0 comments on commit 7f81eb8

Please sign in to comment.