summaryrefslogtreecommitdiffstats
path: root/src/control
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/control/Bridge.cpp20
-rw-r--r--src/control/Bridge.h10
-rw-r--r--src/control/CarAI.cpp1
-rw-r--r--src/control/CarCtrl.cpp38
-rw-r--r--src/control/CarCtrl.h36
-rw-r--r--src/control/Darkel.cpp40
-rw-r--r--src/control/Darkel.h32
-rw-r--r--src/control/GameLogic.cpp2
-rw-r--r--src/control/Garages.cpp45
-rw-r--r--src/control/Garages.h44
-rw-r--r--src/control/PathFind.cpp10
-rw-r--r--src/control/PathFind.h6
-rw-r--r--src/control/Phones.cpp12
-rw-r--r--src/control/Phones.h12
-rw-r--r--src/control/Pickups.cpp16
-rw-r--r--src/control/Pickups.h10
-rw-r--r--src/control/Record.cpp28
-rw-r--r--src/control/Record.h30
-rw-r--r--src/control/Replay.cpp134
-rw-r--r--src/control/Replay.h124
-rw-r--r--src/control/Restart.cpp32
-rw-r--r--src/control/Restart.h32
-rw-r--r--src/control/RoadBlocks.cpp6
-rw-r--r--src/control/RoadBlocks.h6
-rw-r--r--src/control/Script.cpp82
-rw-r--r--src/control/Script.h80
26 files changed, 442 insertions, 446 deletions
diff --git a/src/control/Bridge.cpp b/src/control/Bridge.cpp
index 6a577449..53cf6af2 100644
--- a/src/control/Bridge.cpp
+++ b/src/control/Bridge.cpp
@@ -6,20 +6,20 @@
#include "PathFind.h"
#include "Stats.h"
-CEntity*& CBridge::pLiftRoad = *(CEntity**)0x8E2C8C;
-CEntity*& CBridge::pLiftPart = *(CEntity**)0x8E2C94;
-CEntity*& CBridge::pWeight = *(CEntity**)0x8E28BC;
+CEntity *CBridge::pLiftRoad;
+CEntity *CBridge::pLiftPart;
+CEntity *CBridge::pWeight;
-int& CBridge::State = *(int*)0x8F2A1C;
-int& CBridge::OldState = *(int*)0x8F2A20;
+int CBridge::State;
+int CBridge::OldState;
-float& CBridge::DefaultZLiftPart = *(float*)0x941430;
-float& CBridge::DefaultZLiftRoad = *(float*)0x941438;
-float& CBridge::DefaultZLiftWeight = *(float*)0x8F1A44;
+float CBridge::DefaultZLiftPart;
+float CBridge::DefaultZLiftRoad;
+float CBridge::DefaultZLiftWeight;
-float& CBridge::OldLift = *(float*)0x8F6254;
+float CBridge::OldLift;
-uint32& CBridge::TimeOfBridgeBecomingOperational = *(uint32*)0x8F2BC0;
+uint32 CBridge::TimeOfBridgeBecomingOperational;
void CBridge::Init()
{
diff --git a/src/control/Bridge.h b/src/control/Bridge.h
index 63f41578..c5702629 100644
--- a/src/control/Bridge.h
+++ b/src/control/Bridge.h
@@ -14,11 +14,11 @@ enum bridgeStates {
class CBridge
{
public:
- static CEntity *&pLiftRoad, *&pLiftPart, *&pWeight;
- static int &State, &OldState;
- static float &DefaultZLiftPart, &DefaultZLiftRoad, &DefaultZLiftWeight;
- static float &OldLift;
- static uint32 &TimeOfBridgeBecomingOperational;
+ static CEntity *pLiftRoad, *pLiftPart, *pWeight;
+ static int State, OldState;
+ static float DefaultZLiftPart, DefaultZLiftRoad, DefaultZLiftWeight;
+ static float OldLift;
+ static uint32 TimeOfBridgeBecomingOperational;
static void Init();
static void Update();
diff --git a/src/control/CarAI.cpp b/src/control/CarAI.cpp
index e47e3d5e..f48e4c78 100644
--- a/src/control/CarAI.cpp
+++ b/src/control/CarAI.cpp
@@ -33,7 +33,6 @@ float CCarAI::FindSwitchDistanceFar(CVehicle* pVehicle)
void CCarAI::UpdateCarAI(CVehicle* pVehicle)
{
- //((void(*)(CVehicle*))(0x413E50))(pVehicle);
//return;
if (pVehicle->bIsLawEnforcer){
if (pVehicle->AutoPilot.m_nCarMission == MISSION_BLOCKCAR_FARAWAY ||
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp
index 197fca63..6e47670d 100644
--- a/src/control/CarCtrl.cpp
+++ b/src/control/CarCtrl.cpp
@@ -67,25 +67,25 @@
#define MIN_ANGLE_TO_APPLY_HANDBRAKE 0.7f
#define MIN_SPEED_TO_APPLY_HANDBRAKE 0.3f
-int &CCarCtrl::NumLawEnforcerCars = *(int*)0x8F1B38;
-int &CCarCtrl::NumAmbulancesOnDuty = *(int*)0x885BB0;
-int &CCarCtrl::NumFiretrucksOnDuty = *(int*)0x9411F0;
-bool &CCarCtrl::bCarsGeneratedAroundCamera = *(bool*)0x95CD8A;
-float& CCarCtrl::CarDensityMultiplier = *(float*)0x5EC8B4;
-int32 &CCarCtrl::NumMissionCars = *(int32*)0x8F1B54;
-int32 &CCarCtrl::NumRandomCars = *(int32*)0x943118;
-int32 &CCarCtrl::NumParkedCars = *(int32*)0x8F29E0;
-int32 &CCarCtrl::NumPermanentCars = *(int32*)0x8F29F0;
-int8 &CCarCtrl::CountDownToCarsAtStart = *(int8*)0x95CD63;
-int32 &CCarCtrl::MaxNumberOfCarsInUse = *(int32*)0x5EC8B8;
-uint32 &CCarCtrl::LastTimeLawEnforcerCreated = *(uint32*)0x8F5FF0;
-uint32 &CCarCtrl::LastTimeFireTruckCreated = *(uint32*)0x880F5C;
-uint32 &CCarCtrl::LastTimeAmbulanceCreated = *(uint32*)0x941450;
-int32 (&CCarCtrl::TotalNumOfCarsOfRating)[TOTAL_CUSTOM_CLASSES] = *(int32(*)[TOTAL_CUSTOM_CLASSES])*(uintptr*)0x8F1A60;
-int32 (&CCarCtrl::NextCarOfRating)[TOTAL_CUSTOM_CLASSES] = *(int32(*)[TOTAL_CUSTOM_CLASSES])*(uintptr*)0x9412AC;
-int32 (&CCarCtrl::CarArrays)[TOTAL_CUSTOM_CLASSES][MAX_CAR_MODELS_IN_ARRAY] = *(int32(*)[TOTAL_CUSTOM_CLASSES][MAX_CAR_MODELS_IN_ARRAY])*(uintptr*)0x6EB860;
-CVehicle* (&apCarsToKeep)[MAX_CARS_TO_KEEP] = *(CVehicle*(*)[MAX_CARS_TO_KEEP])*(uintptr*)0x70D830;
-uint32 (&aCarsToKeepTime)[MAX_CARS_TO_KEEP] = *(uint32(*)[MAX_CARS_TO_KEEP])*(uintptr*)0x87F9A8;
+int CCarCtrl::NumLawEnforcerCars;
+int CCarCtrl::NumAmbulancesOnDuty;
+int CCarCtrl::NumFiretrucksOnDuty;
+bool CCarCtrl::bCarsGeneratedAroundCamera;
+float CCarCtrl::CarDensityMultiplier = 1.0f;
+int32 CCarCtrl::NumMissionCars;
+int32 CCarCtrl::NumRandomCars;
+int32 CCarCtrl::NumParkedCars;
+int32 CCarCtrl::NumPermanentCars;
+int8 CCarCtrl::CountDownToCarsAtStart;
+int32 CCarCtrl::MaxNumberOfCarsInUse = 12;
+uint32 CCarCtrl::LastTimeLawEnforcerCreated;
+uint32 CCarCtrl::LastTimeFireTruckCreated;
+uint32 CCarCtrl::LastTimeAmbulanceCreated;
+int32 CCarCtrl::TotalNumOfCarsOfRating[TOTAL_CUSTOM_CLASSES];
+int32 CCarCtrl::NextCarOfRating[TOTAL_CUSTOM_CLASSES];
+int32 CCarCtrl::CarArrays[TOTAL_CUSTOM_CLASSES][MAX_CAR_MODELS_IN_ARRAY];
+CVehicle* apCarsToKeep[MAX_CARS_TO_KEEP];
+uint32 aCarsToKeepTime[MAX_CARS_TO_KEEP];
void
CCarCtrl::GenerateRandomCars()
diff --git a/src/control/CarCtrl.h b/src/control/CarCtrl.h
index 925552b5..44ef9ab6 100644
--- a/src/control/CarCtrl.h
+++ b/src/control/CarCtrl.h
@@ -120,23 +120,23 @@ public:
return angle;
}
- static int32 &NumLawEnforcerCars;
- static int32 &NumAmbulancesOnDuty;
- static int32 &NumFiretrucksOnDuty;
- static int32 &NumRandomCars;
- static int32 &NumMissionCars;
- static int32 &NumParkedCars;
- static int32 &NumPermanentCars;
- static bool &bCarsGeneratedAroundCamera;
- static float &CarDensityMultiplier;
- static int8 &CountDownToCarsAtStart;
- static int32 &MaxNumberOfCarsInUse;
- static uint32 &LastTimeLawEnforcerCreated;
- static uint32 &LastTimeFireTruckCreated;
- static uint32 &LastTimeAmbulanceCreated;
- static int32 (&TotalNumOfCarsOfRating)[TOTAL_CUSTOM_CLASSES];
- static int32 (&NextCarOfRating)[TOTAL_CUSTOM_CLASSES];
- static int32 (&CarArrays)[TOTAL_CUSTOM_CLASSES][MAX_CAR_MODELS_IN_ARRAY];
+ static int32 NumLawEnforcerCars;
+ static int32 NumAmbulancesOnDuty;
+ static int32 NumFiretrucksOnDuty;
+ static int32 NumRandomCars;
+ static int32 NumMissionCars;
+ static int32 NumParkedCars;
+ static int32 NumPermanentCars;
+ static bool bCarsGeneratedAroundCamera;
+ static float CarDensityMultiplier;
+ static int8 CountDownToCarsAtStart;
+ static int32 MaxNumberOfCarsInUse;
+ static uint32 LastTimeLawEnforcerCreated;
+ static uint32 LastTimeFireTruckCreated;
+ static uint32 LastTimeAmbulanceCreated;
+ static int32 TotalNumOfCarsOfRating[TOTAL_CUSTOM_CLASSES];
+ static int32 NextCarOfRating[TOTAL_CUSTOM_CLASSES];
+ static int32 CarArrays[TOTAL_CUSTOM_CLASSES][MAX_CAR_MODELS_IN_ARRAY];
};
-extern CVehicle* (&apCarsToKeep)[MAX_CARS_TO_KEEP]; \ No newline at end of file
+extern CVehicle* apCarsToKeep[MAX_CARS_TO_KEEP]; \ No newline at end of file
diff --git a/src/control/Darkel.cpp b/src/control/Darkel.cpp
index b4d15abf..3265d1c2 100644
--- a/src/control/Darkel.cpp
+++ b/src/control/Darkel.cpp
@@ -17,29 +17,29 @@
#define FRENZY_ANY_PED -1
#define FRENZY_ANY_CAR -2
-int32 &CDarkel::TimeLimit = *(int32*)0x885BAC;
-int32 &CDarkel::PreviousTime = *(int32*)0x885B00;
-int32 &CDarkel::TimeOfFrenzyStart = *(int32*)0x9430D8;
-int32 &CDarkel::WeaponType = *(int32*)0x9430F0;
-int32 &CDarkel::AmmoInterruptedWeapon = *(int32*)0x8E29C8;
-int32 &CDarkel::KillsNeeded = *(int32*)0x8F1AB8;
-int8 &CDarkel::InterruptedWeapon = *(int8*)0x95CD60;
+int32 CDarkel::TimeLimit;
+int32 CDarkel::PreviousTime;
+int32 CDarkel::TimeOfFrenzyStart;
+int32 CDarkel::WeaponType;
+int32 CDarkel::AmmoInterruptedWeapon;
+int32 CDarkel::KillsNeeded;
+int8 CDarkel::InterruptedWeapon;
/*
* bStandardSoundAndMessages is a completely beta thing,
* makes game handle sounds & messages instead of SCM (just like in GTA2)
* but it's never been used in the game. Has unused sliding text when frenzy completed etc.
*/
-int8 &CDarkel::bStandardSoundAndMessages = *(int8*)0x95CDB6;
-int8 &CDarkel::bNeedHeadShot = *(int8*)0x95CDCA;
-int8 &CDarkel::bProperKillFrenzy = *(int8*)0x95CD98;
-uint16 &CDarkel::Status = *(uint16*)0x95CCB4;
-uint16 (&CDarkel::RegisteredKills)[NUM_DEFAULT_MODELS] = *(uint16(*)[NUM_DEFAULT_MODELS]) * (uintptr*)0x6EDBE0;
-int32 &CDarkel::ModelToKill = *(int32*)0x8F2C78;
-int32 &CDarkel::ModelToKill2 = *(int32*)0x885B40;
-int32 &CDarkel::ModelToKill3 = *(int32*)0x885B3C;
-int32 &CDarkel::ModelToKill4 = *(int32*)0x885B34;
-wchar *CDarkel::pStartMessage = (wchar*)0x8F2C08;
+int8 CDarkel::bStandardSoundAndMessages;
+int8 CDarkel::bNeedHeadShot;
+int8 CDarkel::bProperKillFrenzy;
+uint16 CDarkel::Status;
+uint16 CDarkel::RegisteredKills[NUM_DEFAULT_MODELS];
+int32 CDarkel::ModelToKill;
+int32 CDarkel::ModelToKill2;
+int32 CDarkel::ModelToKill3;
+int32 CDarkel::ModelToKill4;
+wchar *CDarkel::pStartMessage;
uint8
CDarkel::CalcFade(uint32 time, uint32 start, uint32 end)
@@ -262,10 +262,10 @@ CDarkel::StartFrenzy(eWeaponType weaponType, int32 time, uint16 kill, int32 mode
pStartMessage = text;
if (text == TheText.Get("PAGE_00")) {
- CDarkel::bProperKillFrenzy = 1;
- CDarkel::pStartMessage = 0;
+ CDarkel::bProperKillFrenzy = true;
+ CDarkel::pStartMessage = nil;
} else
- bProperKillFrenzy = 0;
+ bProperKillFrenzy = false;
bStandardSoundAndMessages = standardSound;
bNeedHeadShot = needHeadShot;
diff --git a/src/control/Darkel.h b/src/control/Darkel.h
index 12ce4451..b6092dcb 100644
--- a/src/control/Darkel.h
+++ b/src/control/Darkel.h
@@ -16,22 +16,22 @@ enum
class CDarkel
{
private:
- static int32 &TimeLimit;
- static int32 &PreviousTime;
- static int32 &TimeOfFrenzyStart;
- static int32 &WeaponType;
- static int32 &AmmoInterruptedWeapon;
- static int32 &KillsNeeded;
- static int8 &InterruptedWeapon;
- static int8 &bStandardSoundAndMessages;
- static int8 &bNeedHeadShot;
- static int8 &bProperKillFrenzy;
- static uint16 &Status;
- static uint16 (&RegisteredKills)[NUM_DEFAULT_MODELS];
- static int32 &ModelToKill;
- static int32 &ModelToKill2;
- static int32 &ModelToKill3;
- static int32 &ModelToKill4;
+ static int32 TimeLimit;
+ static int32 PreviousTime;
+ static int32 TimeOfFrenzyStart;
+ static int32 WeaponType;
+ static int32 AmmoInterruptedWeapon;
+ static int32 KillsNeeded;
+ static int8 InterruptedWeapon;
+ static int8 bStandardSoundAndMessages;
+ static int8 bNeedHeadShot;
+ static int8 bProperKillFrenzy;
+ static uint16 Status;
+ static uint16 RegisteredKills[NUM_DEFAULT_MODELS];
+ static int32 ModelToKill;
+ static int32 ModelToKill2;
+ static int32 ModelToKill3;
+ static int32 ModelToKill4;
static wchar *pStartMessage;
public:
diff --git a/src/control/GameLogic.cpp b/src/control/GameLogic.cpp
index 8e0ea02d..0cfaac17 100644
--- a/src/control/GameLogic.cpp
+++ b/src/control/GameLogic.cpp
@@ -20,7 +20,7 @@
#include "Script.h"
#include "Garages.h"
-uint8 CGameLogic::ActivePlayers; // 0x95CD5E
+uint8 CGameLogic::ActivePlayers;
void
CGameLogic::InitAtStartOfGame()
diff --git a/src/control/Garages.cpp b/src/control/Garages.cpp
index d187f666..cca8c3b8 100644
--- a/src/control/Garages.cpp
+++ b/src/control/Garages.cpp
@@ -111,27 +111,27 @@ const int32 gaCarsToCollectInCraigsGarages[TOTAL_COLLECTCARS_GARAGES][TOTAL_COLL
{ MI_LANDSTAL, MI_LANDSTAL, MI_LANDSTAL, MI_LANDSTAL, MI_LANDSTAL, MI_LANDSTAL, MI_LANDSTAL, MI_LANDSTAL, MI_LANDSTAL, MI_LANDSTAL, MI_LANDSTAL, MI_CHEETAH, MI_TAXI, MI_ESPERANT, MI_SENTINEL, MI_IDAHO }
};
-int32& CGarages::BankVansCollected = *(int32*)0x8F1B34;
-bool& CGarages::BombsAreFree = *(bool*)0x95CD7A;
-bool& CGarages::RespraysAreFree = *(bool*)0x95CD1D;
-int32& CGarages::CarsCollected = *(int32*)0x880E18;
-int32(&CGarages::CarTypesCollected)[TOTAL_COLLECTCARS_GARAGES] = *(int32(*)[TOTAL_COLLECTCARS_GARAGES]) * (uintptr*)0x8E286C;
-int32& CGarages::CrushedCarId = *(int32*)0x943060;
-uint32& CGarages::LastTimeHelpMessage = *(uint32*)0x8F1B58;
-int32& CGarages::MessageNumberInString = *(int32*)0x885BA8;
-char(&CGarages::MessageIDString)[MESSAGE_LENGTH] = *(char(*)[MESSAGE_LENGTH]) * (uintptr*)0x878358;
-int32& CGarages::MessageNumberInString2 = *(int32*)0x8E2C14;
-uint32& CGarages::MessageStartTime = *(uint32*)0x8F2530;
-uint32& CGarages::MessageEndTime = *(uint32*)0x8F597C;
-uint32& CGarages::NumGarages = *(uint32*)0x8F29F4;
-bool& CGarages::PlayerInGarage = *(bool*)0x95CD83;
-int32& CGarages::PoliceCarsCollected = *(int32*)0x941444;
-CStoredCar(&CGarages::aCarsInSafeHouse1)[NUM_GARAGE_STORED_CARS] = *(CStoredCar(*)[NUM_GARAGE_STORED_CARS]) * (uintptr*)0x6FA210;
-CStoredCar(&CGarages::aCarsInSafeHouse2)[NUM_GARAGE_STORED_CARS] = *(CStoredCar(*)[NUM_GARAGE_STORED_CARS]) * (uintptr*)0x6FA300;
-CStoredCar(&CGarages::aCarsInSafeHouse3)[NUM_GARAGE_STORED_CARS] = *(CStoredCar(*)[NUM_GARAGE_STORED_CARS]) * (uintptr*)0x6FA3F0;
-int32& CGarages::AudioEntity = *(int32*)0x5ECEA8;
-CGarage(&CGarages::aGarages)[NUM_GARAGES] = *(CGarage(*)[NUM_GARAGES]) * (uintptr*)0x72BCD0;
-bool& CGarages::bCamShouldBeOutisde = *(bool*)0x95CDB2;
+int32 CGarages::BankVansCollected;
+bool CGarages::BombsAreFree;
+bool CGarages::RespraysAreFree;
+int32 CGarages::CarsCollected;
+int32 CGarages::CarTypesCollected[TOTAL_COLLECTCARS_GARAGES];
+int32 CGarages::CrushedCarId;
+uint32 CGarages::LastTimeHelpMessage;
+int32 CGarages::MessageNumberInString;
+char CGarages::MessageIDString[MESSAGE_LENGTH];
+int32 CGarages::MessageNumberInString2;
+uint32 CGarages::MessageStartTime;
+uint32 CGarages::MessageEndTime;
+uint32 CGarages::NumGarages;
+bool CGarages::PlayerInGarage;
+int32 CGarages::PoliceCarsCollected;
+CStoredCar CGarages::aCarsInSafeHouse1[NUM_GARAGE_STORED_CARS];
+CStoredCar CGarages::aCarsInSafeHouse2[NUM_GARAGE_STORED_CARS];
+CStoredCar CGarages::aCarsInSafeHouse3[NUM_GARAGE_STORED_CARS];
+int32 CGarages::AudioEntity = AEHANDLE_NONE;
+CGarage CGarages::aGarages[NUM_GARAGES];
+bool CGarages::bCamShouldBeOutisde;
void CGarages::Init(void)
{
@@ -2256,7 +2256,7 @@ void CGarages::Save(uint8 * buf, uint32 * size)
#endif
}
-CStoredCar::CStoredCar(const CStoredCar & other)
+const CStoredCar &CStoredCar::operator=(const CStoredCar & other)
{
m_nModelIndex = other.m_nModelIndex;
m_vecPos = other.m_vecPos;
@@ -2272,6 +2272,7 @@ CStoredCar::CStoredCar(const CStoredCar & other)
m_nVariationA = other.m_nVariationA;
m_nVariationB = other.m_nVariationB;
m_nCarBombType = other.m_nCarBombType;
+ return *this;
}
void CGarages::Load(uint8* buf, uint32 size)
diff --git a/src/control/Garages.h b/src/control/Garages.h
index 26e7a89a..65193b32 100644
--- a/src/control/Garages.h
+++ b/src/control/Garages.h
@@ -70,7 +70,7 @@ public:
void Init() { m_nModelIndex = 0; }
void Clear() { m_nModelIndex = 0; }
bool HasCar() { return m_nModelIndex != 0; }
- CStoredCar(const CStoredCar& other);
+ const CStoredCar &operator=(const CStoredCar& other);
void StoreCar(CVehicle*);
CVehicle* RestoreCar();
};
@@ -179,27 +179,27 @@ class CGarages
enum {
MESSAGE_LENGTH = 8
};
- static int32 &BankVansCollected;
- static bool &BombsAreFree;
- static bool &RespraysAreFree;
- static int32 &CarsCollected;
- static int32 (&CarTypesCollected)[TOTAL_COLLECTCARS_GARAGES];
- static int32 &CrushedCarId;
- static uint32 &LastTimeHelpMessage;
- static int32 &MessageNumberInString;
- static char(&MessageIDString)[MESSAGE_LENGTH];
- static int32 &MessageNumberInString2;
- static uint32 &MessageStartTime;
- static uint32 &MessageEndTime;
- static uint32 &NumGarages;
- static bool &PlayerInGarage;
- static int32 &PoliceCarsCollected;
- static CGarage(&aGarages)[NUM_GARAGES];
- static CStoredCar(&aCarsInSafeHouse1)[NUM_GARAGE_STORED_CARS];
- static CStoredCar(&aCarsInSafeHouse2)[NUM_GARAGE_STORED_CARS];
- static CStoredCar(&aCarsInSafeHouse3)[NUM_GARAGE_STORED_CARS];
- static int32 &AudioEntity;
- static bool &bCamShouldBeOutisde;
+ static int32 BankVansCollected;
+ static bool BombsAreFree;
+ static bool RespraysAreFree;
+ static int32 CarsCollected;
+ static int32 CarTypesCollected[TOTAL_COLLECTCARS_GARAGES];
+ static int32 CrushedCarId;
+ static uint32 LastTimeHelpMessage;
+ static int32 MessageNumberInString;
+ static char MessageIDString[MESSAGE_LENGTH];
+ static int32 MessageNumberInString2;
+ static uint32 MessageStartTime;
+ static uint32 MessageEndTime;
+ static uint32 NumGarages;
+ static bool PlayerInGarage;
+ static int32 PoliceCarsCollected;
+ static CGarage aGarages[NUM_GARAGES];
+ static CStoredCar aCarsInSafeHouse1[NUM_GARAGE_STORED_CARS];
+ static CStoredCar aCarsInSafeHouse2[NUM_GARAGE_STORED_CARS];
+ static CStoredCar aCarsInSafeHouse3[NUM_GARAGE_STORED_CARS];
+ static int32 AudioEntity;
+ static bool bCamShouldBeOutisde;
public:
static void Init(void);
diff --git a/src/control/PathFind.cpp b/src/control/PathFind.cpp
index 9f45c454..d9594490 100644
--- a/src/control/PathFind.cpp
+++ b/src/control/PathFind.cpp
@@ -12,7 +12,7 @@ bool gbShowPedPaths;
bool gbShowCarPaths;
bool gbShowCarPathsLinks;
-CPathFind &ThePaths = *(CPathFind*)0x8F6754;
+CPathFind ThePaths;
#define MAX_DIST INT16_MAX-1
#define MIN_PED_ROUTE_DISTANCE 23.8f
@@ -21,11 +21,11 @@ CPathFind &ThePaths = *(CPathFind*)0x8F6754;
// 1 UseInRoadBlock
// 2 east/west road(?)
-CPathInfoForObject *&InfoForTileCars = *(CPathInfoForObject**)0x8F1A8C;
-CPathInfoForObject *&InfoForTilePeds = *(CPathInfoForObject**)0x8F1AE4;
+CPathInfoForObject *InfoForTileCars;
+CPathInfoForObject *InfoForTilePeds;
// unused
-CTempDetachedNode *&DetachedNodesCars = *(CTempDetachedNode**)0x8E2824;
-CTempDetachedNode *&DetachedNodesPeds = *(CTempDetachedNode**)0x8E28A0;
+CTempDetachedNode *DetachedNodesCars;
+CTempDetachedNode *DetachedNodesPeds;
bool
CPedPath::CalcPedRoute(int8 pathType, CVector position, CVector destination, CVector *pointPoses, int16 *pointsFound, int16 maxPoints)
diff --git a/src/control/PathFind.h b/src/control/PathFind.h
index ea88ade6..64c12d5b 100644
--- a/src/control/PathFind.h
+++ b/src/control/PathFind.h
@@ -138,8 +138,8 @@ struct CPathInfoForObject
int8 numRightLanes;
uint8 crossing : 1;
};
-extern CPathInfoForObject *&InfoForTileCars;
-extern CPathInfoForObject *&InfoForTilePeds;
+extern CPathInfoForObject *InfoForTileCars;
+extern CPathInfoForObject *InfoForTilePeds;
struct CTempNode
{
@@ -234,7 +234,7 @@ public:
};
static_assert(sizeof(CPathFind) == 0x49bf4, "CPathFind: error");
-extern CPathFind &ThePaths;
+extern CPathFind ThePaths;
extern bool gbShowPedPaths;
extern bool gbShowCarPaths;
diff --git a/src/control/Phones.cpp b/src/control/Phones.cpp
index 276f02b9..90939f0e 100644
--- a/src/control/Phones.cpp
+++ b/src/control/Phones.cpp
@@ -13,13 +13,13 @@
#include "RpAnimBlend.h"
#include "AnimBlendAssociation.h"
-CPhoneInfo &gPhoneInfo = *(CPhoneInfo*)0x732A20;
+CPhoneInfo gPhoneInfo;
-bool &CPhoneInfo::bDisplayingPhoneMessage = *(bool*)0x6283AC; // is phone picked up
-uint32 &CPhoneInfo::PhoneEnableControlsTimer = *(uint32*)0x6283A8;
-CPhone *&CPhoneInfo::pPhoneDisplayingMessages = *(CPhone**)0x6283B0;
-bool &CPhoneInfo::bPickingUpPhone = *(bool*)0x6283B4;
-CPed *&CPhoneInfo::pCallBackPed = *(CPed**)0x6283B8; // ped who picking up the phone (reset after pickup cb)
+bool CPhoneInfo::bDisplayingPhoneMessage; // is phone picked up
+uint32 CPhoneInfo::PhoneEnableControlsTimer;
+CPhone *CPhoneInfo::pPhoneDisplayingMessages;
+bool CPhoneInfo::bPickingUpPhone;
+CPed *CPhoneInfo::pCallBackPed; // ped who picking up the phone (reset after pickup cb)
/*
Entering phonebooth cutscene, showing messages and triggering these things
diff --git a/src/control/Phones.h b/src/control/Phones.h
index e7e3c9a7..7fbf403f 100644
--- a/src/control/Phones.h
+++ b/src/control/Phones.h
@@ -36,11 +36,11 @@ static_assert(sizeof(CPhone) == 0x34, "CPhone: error");
class CPhoneInfo {
public:
- static bool &bDisplayingPhoneMessage;
- static uint32 &PhoneEnableControlsTimer;
- static CPhone *&pPhoneDisplayingMessages;
- static bool &bPickingUpPhone;
- static CPed *&pCallBackPed;
+ static bool bDisplayingPhoneMessage;
+ static uint32 PhoneEnableControlsTimer;
+ static CPhone *pPhoneDisplayingMessages;
+ static bool bPickingUpPhone;
+ static CPed *pCallBackPed;
int32 m_nMax;
int32 m_nScriptPhonesMax;
@@ -63,7 +63,7 @@ public:
void Update(void);
};
-extern CPhoneInfo &gPhoneInfo;
+extern CPhoneInfo gPhoneInfo;
void PhonePutDownCB(CAnimBlendAssociation *assoc, void *arg);
void PhonePickUpCB(CAnimBlendAssociation *assoc, void *arg);
diff --git a/src/control/Pickups.cpp b/src/control/Pickups.cpp
index eb561670..d52c386c 100644
--- a/src/control/Pickups.cpp
+++ b/src/control/Pickups.cpp
@@ -31,16 +31,16 @@
#include "WaterLevel.h"
#include "World.h"
-CPickup(&CPickups::aPickUps)[NUMPICKUPS] = *(CPickup(*)[NUMPICKUPS])*(uintptr*)0x878C98;
-int16 CPickups::NumMessages;// = *(int16*)0x95CC98;
-int32 CPickups::aPickUpsCollected[NUMCOLLECTEDPICKUPS];// = *(int32(*)[NUMCOLLECTEDPICKUPS])*(uintptr*)0x87C538;
-int16 CPickups::CollectedPickUpIndex;// = *(int16*)0x95CC8A;
+CPickup CPickups::aPickUps[NUMPICKUPS];
+int16 CPickups::NumMessages;
+int32 CPickups::aPickUpsCollected[NUMCOLLECTEDPICKUPS];
+int16 CPickups::CollectedPickUpIndex;
// unused
-bool &CPickups::bPickUpcamActivated = *(bool*)0x95CD71;
-CVehicle *&CPickups::pPlayerVehicle = *(CVehicle**)0x8F29E8;
-CVector &CPickups::StaticCamCoors = *(CVector*)0x9404C8;
-uint32 &CPickups::StaticCamStartTime = *(uint32*)0x8E289C;
+bool CPickups::bPickUpcamActivated;
+CVehicle *CPickups::pPlayerVehicle;
+CVector CPickups::StaticCamCoors;
+uint32 CPickups::StaticCamStartTime;
tPickupMessage CPickups::aMessages[NUMPICKUPMESSAGES];
diff --git a/src/control/Pickups.h b/src/control/Pickups.h
index b5b4f396..11da5f54 100644
--- a/src/control/Pickups.h
+++ b/src/control/Pickups.h
@@ -89,13 +89,13 @@ public:
static void Load(uint8 *buf, uint32 size);
static void Save(uint8 *buf, uint32 *size);
- static CPickup(&aPickUps)[NUMPICKUPS];
+ static CPickup aPickUps[NUMPICKUPS];
// unused
- static bool &bPickUpcamActivated;
- static CVehicle *&pPlayerVehicle;
- static CVector &StaticCamCoors;
- static uint32 &StaticCamStartTime;
+ static bool bPickUpcamActivated;
+ static CVehicle *pPlayerVehicle;
+ static CVector StaticCamCoors;
+ static uint32 StaticCamStartTime;
};
extern uint16 AmmoForWeapon[20];
diff --git a/src/control/Record.cpp b/src/control/Record.cpp
index ca4128e3..08e3c5b9 100644
--- a/src/control/Record.cpp
+++ b/src/control/Record.cpp
@@ -10,11 +10,11 @@
#include "VehicleModelInfo.h"
#include "World.h"
-uint16 &CRecordDataForGame::RecordingState = *(uint16*)0x95CC24;
-uint8*& CRecordDataForGame::pDataBuffer = *(uint8**)0x8F1B70;
-uint8*& CRecordDataForGame::pDataBufferPointer = *(uint8**)0x8F1AB0;
-int& CRecordDataForGame::FId = *(int*)0x885BA4;
-tGameBuffer& CRecordDataForGame::pDataBufferForFrame = *(tGameBuffer*)0x72CED0;
+uint16 CRecordDataForGame::RecordingState;
+uint8* CRecordDataForGame::pDataBuffer;
+uint8* CRecordDataForGame::pDataBufferPointer;
+int CRecordDataForGame::FId;
+tGameBuffer CRecordDataForGame::pDataBufferForFrame;
#define MEMORY_FOR_GAME_RECORD (150000)
@@ -176,15 +176,15 @@ uint16 CRecordDataForGame::CalcGameChecksum(void)
return checksum ^ checksum >> 16;
}
-uint8& CRecordDataForChase::Status = *(uint8*)0x95CDCE;
-int& CRecordDataForChase::PositionChanges = *(int*)0x8F59C8;
-uint8& CRecordDataForChase::CurrentCar = *(uint8*)0x95CDC9;
-CAutomobile* (&CRecordDataForChase::pChaseCars)[NUM_CHASE_CARS] = *(CAutomobile * (*)[NUM_CHASE_CARS])*(uintptr*)0x6F46A8;
-uint32& CRecordDataForChase::AnimStartTime = *(uint32*)0x8F1AEC;
-float& CRecordDataForChase::AnimTime = *(float*)0x880F88;
-CCarStateEachFrame* (&CRecordDataForChase::pBaseMemForCar)[NUM_CHASE_CARS] = *(CCarStateEachFrame * (*)[NUM_CHASE_CARS])*(uintptr*)0x70EA18;
-float& CRecordDataForChase::TimeMultiplier = *(float*)0x8E2A94;
-int& CRecordDataForChase::FId2 = *(int*)0x8E2C18;
+uint8 CRecordDataForChase::Status;
+int CRecordDataForChase::PositionChanges;
+uint8 CRecordDataForChase::CurrentCar;
+CAutomobile* CRecordDataForChase::pChaseCars[NUM_CHASE_CARS];
+uint32 CRecordDataForChase::AnimStartTime;
+float CRecordDataForChase::AnimTime;
+CCarStateEachFrame* CRecordDataForChase::pBaseMemForCar[NUM_CHASE_CARS];
+float CRecordDataForChase::TimeMultiplier;
+int CRecordDataForChase::FId2;
#define CHASE_SCENE_LENGTH_IN_SECONDS (80)
#define CHASE_SCENE_FRAMES_PER_SECOND (15) // skipping every second frame
diff --git a/src/control/Record.h b/src/control/Record.h
index 4abeb68a..7af733ba 100644
--- a/src/control/Record.h
+++ b/src/control/Record.h
@@ -23,7 +23,7 @@ public:
CVector pos;
};
-extern char* gString;
+extern char gString[256];;
class CRecordDataForChase
{
@@ -37,15 +37,15 @@ class CRecordDataForChase
STATE_PLAYBACK = 3,
STATE_PLAYBACK_BEFORE_RECORDING = 4
};
- static uint8 &Status;
- static int &PositionChanges;
- static uint8 &CurrentCar;
- static CAutomobile*(&pChaseCars)[NUM_CHASE_CARS];
- static float &AnimTime;
- static uint32 &AnimStartTime;
- static CCarStateEachFrame* (&pBaseMemForCar)[NUM_CHASE_CARS];
- static float &TimeMultiplier;
- static int &FId2;
+ static uint8 Status;
+ static int PositionChanges;
+ static uint8 CurrentCar;
+ static CAutomobile*pChaseCars[NUM_CHASE_CARS];
+ static float AnimTime;
+ static uint32 AnimStartTime;
+ static CCarStateEachFrame* pBaseMemForCar[NUM_CHASE_CARS];
+ static float TimeMultiplier;
+ static int FId2;
public:
static bool IsRecording(void) { return Status == STATE_RECORD; }
@@ -86,11 +86,11 @@ class CRecordDataForGame
STATE_RECORD = 1,
STATE_PLAYBACK = 2,
};
- static uint16& RecordingState;
- static uint8* &pDataBuffer;
- static uint8* &pDataBufferPointer;
- static int &FId;
- static tGameBuffer &pDataBufferForFrame;
+ static uint16 RecordingState;
+ static uint8* pDataBuffer;
+ static uint8* pDataBufferPointer;
+ static int FId;
+ static tGameBuffer pDataBufferForFrame;
public:
static bool IsRecording() { return RecordingState == STATE_RECORD; }
diff --git a/src/control/Replay.cpp b/src/control/Replay.cpp
index c4a1e686..0570f9a8 100644
--- a/src/control/Replay.cpp
+++ b/src/control/Replay.cpp
@@ -39,71 +39,70 @@
#include "Camera.h"
#include "Radar.h"
-uint8 &CReplay::Mode = *(uint8*)0x95CD5B;
-CAddressInReplayBuffer &CReplay::Record = *(CAddressInReplayBuffer*)0x942F7C;
-CAddressInReplayBuffer &CReplay::Playback = *(CAddressInReplayBuffer*)0x8F5F48;
-uint8 *&CReplay::pBuf0 = *(uint8**)0x8E2C64;
-CAutomobile *&CReplay::pBuf1 = *(CAutomobile**)0x8E2C68;
-uint8 *&CReplay::pBuf2 = *(uint8**)0x8E2C6C;
-CPlayerPed *&CReplay::pBuf3 = *(CPlayerPed**)0x8E2C70;
-uint8 *&CReplay::pBuf4 = *(uint8**)0x8E2C74;
-CCutsceneHead *&CReplay::pBuf5 = *(CCutsceneHead**)0x8E2C78;
-uint8 *&CReplay::pBuf6 = *(uint8**)0x8E2C80;
-CPtrNode *&CReplay::pBuf7 = *(CPtrNode**)0x8E2C84;
-uint8 *&CReplay::pBuf8 = *(uint8**)0x8E2C54;
-CEntryInfoNode *&CReplay::pBuf9 = *(CEntryInfoNode**)0x8E2C58;
-uint8 *&CReplay::pBuf10 = *(uint8**)0x8F2C28;
-CDummyPed *&CReplay::pBuf11 = *(CDummyPed**)0x8F2C2C;
-uint8 *&CReplay::pRadarBlips = *(uint8**)0x8F29F8;
-uint8 *&CReplay::pStoredCam = *(uint8**)0x8F2C34;
-uint8 *&CReplay::pWorld1 = *(uint8**)0x8E29C4;
-CReference *&CReplay::pEmptyReferences = *(CReference**)0x8F256C;
-CStoredDetailedAnimationState *&CReplay::pPedAnims = *(CStoredDetailedAnimationState**)0x8F6260;
-uint8 *&CReplay::pPickups = *(uint8**)0x8F1A48;
-uint8 *&CReplay::pReferences = *(uint8**)0x880FAC;
-uint8(&CReplay::BufferStatus)[NUM_REPLAYBUFFERS] = *(uint8(*)[NUM_REPLAYBUFFERS])*(uintptr*)0x8804D8;
-uint8(&CReplay::Buffers)[NUM_REPLAYBUFFERS][REPLAYBUFFERSIZE] = *(uint8(*)[NUM_REPLAYBUFFERS][REPLAYBUFFERSIZE])*(uintptr*)0x779958;
-bool &CReplay::bPlayingBackFromFile = *(bool*)0x95CD58;
-bool &CReplay::bReplayEnabled = *(bool*)0x617CAC;
-uint32 &CReplay::SlowMotion = *(uint32*)0x9414D4;
-uint32 &CReplay::FramesActiveLookAroundCam = *(uint32*)0x880F84;
-bool &CReplay::bDoLoadSceneWhenDone = *(bool*)0x95CD76;
-CPtrList &CReplay::WorldPtrList = *(CPtrList*)0x880F90;
-CPtrList &CReplay::BigBuildingPtrList = *(CPtrList*)0x941284;
-CWanted &CReplay::PlayerWanted = *(CWanted*)0x8F6278;
-CPlayerInfo &CReplay::PlayerInfo = *(CPlayerInfo*)0x8F5840;
-uint32 &CReplay::Time1 = *(uint32*)0x8F29DC;
-uint32 &CReplay::Time2 = *(uint32*)0x8F29D0;
-uint32 &CReplay::Time3 = *(uint32*)0x8F29D4;
-uint32 &CReplay::Time4 = *(uint32*)0x8F29C8;
-uint32 &CReplay::Frame = *(uint32*)0x8F2554;
-uint8 &CReplay::ClockHours = *(uint8*)0x95CDC5;
-uint8 &CReplay::ClockMinutes = *(uint8*)0x95CDA2;
-uint16 &CReplay::OldWeatherType = *(uint16*)0x95CCEA;
-uint16 &CReplay::NewWeatherType = *(uint16*)0x95CC6E;
-float &CReplay::WeatherInterpolationValue = *(float*)0x8F1A28;
-float &CReplay::TimeStepNonClipped = *(float*)0x8F5FF4;
-float &CReplay::TimeStep = *(float*)0x8F2C24;
-float &CReplay::TimeScale = *(float*)0x880E20;
-float &CReplay::CameraFixedX = *(float*)0x943054;
-float &CReplay::CameraFixedY = *(float*)0x943058;
-float &CReplay::CameraFixedZ = *(float*)0x94305C;
-int32 &CReplay::OldRadioStation = *(int32*)0x94151C;
-int8 &CReplay::CameraMode = *(int8*)0x95CD5F;
-bool &CReplay::bAllowLookAroundCam = *(bool*)0x95CDCD;
-float &CReplay::LoadSceneX = *(float*)0x880F9C;
-float &CReplay::LoadSceneY = *(float*)0x880F98;
-float &CReplay::LoadSceneZ = *(float*)0x880F94;
-float &CReplay::CameraFocusX = *(float*)0x942F5C;
-float &CReplay::CameraFocusY = *(float*)0x942F74;
-float &CReplay::CameraFocusZ = *(float*)0x942F58;
-bool &CReplay::bPlayerInRCBuggy = *(bool*)0x95CDC3;
-float &CReplay::fDistanceLookAroundCam = *(float*)0x885B44;
-float &CReplay::fBetaAngleLookAroundCam = *(float*)0x94072C;
-float &CReplay::fAlphaAngleLookAroundCam = *(float*)0x8F2A0C;
+uint8 CReplay::Mode;
+CAddressInReplayBuffer CReplay::Record;
+CAddressInReplayBuffer CReplay::Playback;
+uint8 *CReplay::pBuf0;
+CAutomobile *CReplay::pBuf1;
+uint8 *CReplay::pBuf2;
+CPlayerPed *CReplay::pBuf3;
+uint8 *CReplay::pBuf4;
+CCutsceneHead *CReplay::pBuf5;
+uint8 *CReplay::pBuf6;
+CPtrNode *CReplay::pBuf7;
+uint8 *CReplay::pBuf8;
+CEntryInfoNode *CReplay::pBuf9;
+uint8 *CReplay::pBuf10;
+CDummyPed *CReplay::pBuf11;
+uint8 *CReplay::pRadarBlips;
+uint8 *CReplay::pStoredCam;
+uint8 *CReplay::pWorld1;
+CReference *CReplay::pEmptyReferences;
+CStoredDetailedAnimationState *CReplay::pPedAnims;
+uint8 *CReplay::pPickups;
+uint8 *CReplay::pReferences;
+uint8 CReplay::BufferStatus[NUM_REPLAYBUFFERS];
+uint8 CReplay::Buffers[NUM_REPLAYBUFFERS][REPLAYBUFFERSIZE];
+bool CReplay::bPlayingBackFromFile;
+bool CReplay::bReplayEnabled = true;
+uint32 CReplay::SlowMotion;
+uint32 CReplay::FramesActiveLookAroundCam;
+bool CReplay::bDoLoadSceneWhenDone;
+CPtrList CReplay::WorldPtrList;
+CPtrList CReplay::BigBuildingPtrList;
+CWanted CReplay::PlayerWanted;
+CPlayerInfo CReplay::PlayerInfo;
+uint32 CReplay::Time1;
+uint32 CReplay::Time2;
+uint32 CReplay::Time3;
+uint32 CReplay::Time4;
+uint32 CReplay::Frame;
+uint8 CReplay::ClockHours;
+uint8 CReplay::ClockMinutes;
+uint16 CReplay::OldWeatherType;
+uint16 CReplay::NewWeatherType;
+float CReplay::WeatherInterpolationValue;
+float CReplay::TimeStepNonClipped;
+float CReplay::TimeStep;
+float CReplay::TimeScale;
+float CReplay::CameraFixedX;
+float CReplay::CameraFixedY;
+float CReplay::CameraFixedZ;
+int32 CReplay::OldRadioStation;
+int8 CReplay::CameraMode;
+bool CReplay::bAllowLookAroundCam;
+float CReplay::LoadSceneX;
+float CReplay::LoadSceneY;
+float CReplay::LoadSceneZ;
+float CReplay::CameraFocusX;
+float CReplay::CameraFocusY;
+float CReplay::CameraFocusZ;
+bool CReplay::bPlayerInRCBuggy;
+float CReplay::fDistanceLookAroundCam;
+float CReplay::fBetaAngleLookAroundCam;
+float CReplay::fAlphaAngleLookAroundCam;
-static void(*(&CBArray)[30])(CAnimBlendAssociation*, void*) = *(void(*(*)[30])(CAnimBlendAssociation*, void*))*(uintptr*)0x61052C;
-static void(*CBArray_RE3[])(CAnimBlendAssociation*, void*) =
+static void(*CBArray[])(CAnimBlendAssociation*, void*) =
{
nil, &CPed::PedGetupCB, &CPed::PedStaggerCB, &CPed::PedEvadeCB, &CPed::FinishDieAnimCB,
&CPed::FinishedWaitCB, &CPed::FinishLaunchCB, &CPed::FinishHitHeadCB, &CPed::PedAnimGetInCB, &CPed::PedAnimDoorOpenCB,
@@ -119,16 +118,13 @@ static uint8 FindCBFunctionID(void(*f)(CAnimBlendAssociation*, void*))
if (CBArray[i] == f)
return i;
}
- for (int i = 0; i < sizeof(CBArray_RE3) / sizeof(*CBArray_RE3); i++) {
- if (CBArray_RE3[i] == f)
- return i;
- }
+
return 0;
}
static void(*FindCBFunction(uint8 id))(CAnimBlendAssociation*, void*)
{
- return CBArray_RE3[id];
+ return CBArray[id];
}
static void ApplyPanelDamageToCar(uint32 panels, CAutomobile* vehicle, bool flying)
diff --git a/src/control/Replay.h b/src/control/Replay.h
index 56de52a3..6f6c2a91 100644
--- a/src/control/Replay.h
+++ b/src/control/Replay.h
@@ -205,68 +205,68 @@ class CReplay
static_assert(sizeof(tVehicleUpdatePacket) == 48, "tVehicleUpdatePacket: error");
private:
- static uint8 &Mode;
- static CAddressInReplayBuffer &Record;
- static CAddressInReplayBuffer &Playback;
- static uint8 *&pBuf0;
- static CAutomobile *&pBuf1;
- static uint8 *&pBuf2;
- static CPlayerPed *&pBuf3;
- static uint8 *&pBuf4;
- static CCutsceneHead *&pBuf5;
- static uint8 *&pBuf6;
- static CPtrNode *&pBuf7;
- static uint8 *&pBuf8;
- static CEntryInfoNode *&pBuf9;
- static uint8 *&pBuf10;
- static CDummyPed *&pBuf11;
- static uint8 *&pRadarBlips;
- static uint8 *&pStoredCam;
- static uint8 *&pWorld1;
- static CReference *&pEmptyReferences;
- static CStoredDetailedAnimationState *&pPedAnims;
- static uint8 *&pPickups;
- static uint8 *&pReferences;
- static uint8 (&BufferStatus)[NUM_REPLAYBUFFERS];
- static uint8 (&Buffers)[NUM_REPLAYBUFFERS][REPLAYBUFFERSIZE];
- static bool &bPlayingBackFromFile;
- static bool &bReplayEnabled;
- static uint32 &SlowMotion;
- static uint32 &FramesActiveLookAroundCam;
- static bool &bDoLoadSceneWhenDone;
- static CPtrList &WorldPtrList;
- static CPtrList &BigBuildingPtrList;
- static CWanted &PlayerWanted;
- static CPlayerInfo &PlayerInfo;
- static uint32 &Time1;
- static uint32 &Time2;
- static uint32 &Time3;
- static uint32 &Time4;
- static uint32 &Frame;
- static uint8 &ClockHours;
- static uint8 &ClockMinutes;
- static uint16 &OldWeatherType;
- static uint16 &NewWeatherType;
- static float &WeatherInterpolationValue;
- static float &TimeStepNonClipped;
- static float &TimeStep;
- static float &TimeScale;
- static float &CameraFixedX;
- static float &CameraFixedY;
- static float &CameraFixedZ;
- static int32 &OldRadioStation;
- static int8 &CameraMode;
- static bool &bAllowLookAroundCam;
- static float &LoadSceneX;
- static float &LoadSceneY;
- static float &LoadSceneZ;
- static float &CameraFocusX;
- static float &CameraFocusY;
- static float &CameraFocusZ;
- static bool &bPlayerInRCBuggy;
- static float &fDistanceLookAroundCam;
- static float &fAlphaAngleLookAroundCam;
- static float &fBetaAngleLookAroundCam;
+ static uint8 Mode;
+ static CAddressInReplayBuffer Record;
+ static CAddressInReplayBuffer Playback;
+ static uint8 *pBuf0;
+ static CAutomobile *pBuf1;
+ static uint8 *pBuf2;
+ static CPlayerPed *pBuf3;
+ static uint8 *pBuf4;
+ static CCutsceneHead *pBuf5;
+ static uint8 *pBuf6;
+ static CPtrNode *pBuf7;
+ static uint8 *pBuf8;
+ static CEntryInfoNode *pBuf9;
+ static uint8 *pBuf10;
+ static CDummyPed *pBuf11;
+ static uint8 *pRadarBlips;
+ static uint8 *pStoredCam;
+ static uint8 *pWorld1;
+ static CReference *pEmptyReferences;
+ static CStoredDetailedAnimationState *pPedAnims;
+ static uint8 *pPickups;
+ static uint8 *pReferences;
+ static uint8 BufferStatus[NUM_REPLAYBUFFERS];
+ static uint8 Buffers[NUM_REPLAYBUFFERS][REPLAYBUFFERSIZE];
+ static bool bPlayingBackFromFile;
+ static bool bReplayEnabled;
+ static uint32 SlowMotion;
+ static uint32 FramesActiveLookAroundCam;
+ static bool bDoLoadSceneWhenDone;
+ static CPtrList WorldPtrList;
+ static CPtrList BigBuildingPtrList;
+ static CWanted PlayerWanted;
+ static CPlayerInfo PlayerInfo;
+ static uint32 Time1;
+ static uint32 Time2;
+ static uint32 Time3;
+ static uint32 Time4;
+ static uint32 Frame;
+ static uint8 ClockHours;
+ static uint8 ClockMinutes;
+ static uint16 OldWeatherType;
+ static uint16 NewWeatherType;
+ static float WeatherInterpolationValue;
+ static float TimeStepNonClipped;
+ static float TimeStep;
+ static float TimeScale;
+ static float CameraFixedX;
+ static float CameraFixedY;
+ static float CameraFixedZ;
+ static int32 OldRadioStation;
+ static int8 CameraMode;
+ static bool bAllowLookAroundCam;
+ static float LoadSceneX;
+ static float LoadSceneY;
+ static float LoadSceneZ;
+ static float CameraFocusX;
+ static float CameraFocusY;
+ static float CameraFocusZ;
+ static bool bPlayerInRCBuggy;
+ static float fDistanceLookAroundCam;
+ static float fAlphaAngleLookAroundCam;
+ static float fBetaAngleLookAroundCam;
public:
static void Init(void);
diff --git a/src/control/Restart.cpp b/src/control/Restart.cpp
index 788a054a..2730f5c0 100644
--- a/src/control/Restart.cpp
+++ b/src/control/Restart.cpp
@@ -4,22 +4,22 @@
#include "Zones.h"
#include "PathFind.h"
-uint8 &CRestart::OverrideHospitalLevel = *(uint8*)0x95CD4C;
-uint8 &CRestart::OverridePoliceStationLevel = *(uint8*)0x95CD50;
-bool &CRestart::bFadeInAfterNextArrest = *(bool*)0x95CD69;
-bool &CRestart::bFadeInAfterNextDeath = *(bool*)0x95CD9D;
-
-bool &CRestart::bOverrideRestart = *(bool*)0x95CD5D;
-CVector &CRestart::OverridePosition = *(CVector*)0x8E2C00;
-float &CRestart::OverrideHeading = *(float*)0x8F2A18;
-
-CVector(&CRestart::HospitalRestartPoints)[NUM_RESTART_POINTS] = *(CVector(*)[NUM_RESTART_POINTS])*(uintptr*)0x87F9B0;
-float(&CRestart::HospitalRestartHeadings)[NUM_RESTART_POINTS] = *(float(*)[NUM_RESTART_POINTS])*(uintptr*)0x6F1D40;
-uint16 &CRestart::NumberOfHospitalRestarts = *(uint16*)0x95CC46;
-
-CVector(&CRestart::PoliceRestartPoints)[NUM_RESTART_POINTS] = *(CVector(*)[NUM_RESTART_POINTS])*(uintptr*)0x846228;
-float(&CRestart::PoliceRestartHeadings)[NUM_RESTART_POINTS] = *(float(*)[NUM_RESTART_POINTS])*(uintptr*)0x6F1D20;
-uint16 &CRestart::NumberOfPoliceRestarts = *(uint16*)0x95CC44;
+uint8 CRestart::OverrideHospitalLevel;
+uint8 CRestart::OverridePoliceStationLevel;
+bool CRestart::bFadeInAfterNextArrest;
+bool CRestart::bFadeInAfterNextDeath;
+
+bool CRestart::bOverrideRestart;
+CVector CRestart::OverridePosition;
+float CRestart::OverrideHeading;
+
+CVector CRestart::HospitalRestartPoints[NUM_RESTART_POINTS];
+float CRestart::HospitalRestartHeadings[NUM_RESTART_POINTS];
+uint16 CRestart::NumberOfHospitalRestarts;
+
+CVector CRestart::PoliceRestartPoints[NUM_RESTART_POINTS];
+float CRestart::PoliceRestartHeadings[NUM_RESTART_POINTS];
+uint16 CRestart::NumberOfPoliceRestarts;
void
CRestart::Initialise()
diff --git a/src/control/Restart.h b/src/control/Restart.h
index fb7806db..5d84c723 100644
--- a/src/control/Restart.h
+++ b/src/control/Restart.h
@@ -17,20 +17,20 @@ public:
static void LoadAllRestartPoints(uint8 *buf, uint32 size);
static void SaveAllRestartPoints(uint8 *buf, uint32 *size);
- static uint8 &OverrideHospitalLevel;
- static uint8 &OverridePoliceStationLevel;
- static bool &bFadeInAfterNextArrest;
- static bool &bFadeInAfterNextDeath;
-
- static bool &bOverrideRestart;
- static CVector &OverridePosition;
- static float &OverrideHeading;
-
- static CVector(&HospitalRestartPoints)[NUM_RESTART_POINTS];
- static float (&HospitalRestartHeadings)[NUM_RESTART_POINTS];
- static uint16 &NumberOfHospitalRestarts;
-
- static CVector (&PoliceRestartPoints)[NUM_RESTART_POINTS];
- static float (&PoliceRestartHeadings)[NUM_RESTART_POINTS];
- static uint16 &NumberOfPoliceRestarts;
+ static uint8 OverrideHospitalLevel;
+ static uint8 OverridePoliceStationLevel;
+ static bool bFadeInAfterNextArrest;
+ static bool bFadeInAfterNextDeath;
+
+ static bool bOverrideRestart;
+ static CVector OverridePosition;
+ static float OverrideHeading;
+
+ static CVector HospitalRestartPoints[NUM_RESTART_POINTS];
+ static float HospitalRestartHeadings[NUM_RESTART_POINTS];
+ static uint16 NumberOfHospitalRestarts;
+
+ static CVector PoliceRestartPoints[NUM_RESTART_POINTS];
+ static float PoliceRestartHeadings[NUM_RESTART_POINTS];
+ static uint16 NumberOfPoliceRestarts;
};
diff --git a/src/control/RoadBlocks.cpp b/src/control/RoadBlocks.cpp
index 9548bc0a..fcfa42e3 100644
--- a/src/control/RoadBlocks.cpp
+++ b/src/control/RoadBlocks.cpp
@@ -15,9 +15,9 @@
#include "CarCtrl.h"
#include "General.h"
-int16 &CRoadBlocks::NumRoadBlocks = *(int16*)0x95CC34;
-int16 (&CRoadBlocks::RoadBlockObjects)[NUMROADBLOCKS] = *(int16(*)[NUMROADBLOCKS]) * (uintptr*)0x72B3A8;
-bool (&CRoadBlocks::InOrOut)[NUMROADBLOCKS] = *(bool(*)[NUMROADBLOCKS]) * (uintptr*)0x733810;
+int16 CRoadBlocks::NumRoadBlocks;
+int16 CRoadBlocks::RoadBlockObjects[NUMROADBLOCKS];
+bool CRoadBlocks::InOrOut[NUMROADBLOCKS];
void
CRoadBlocks::Init(void)
diff --git a/src/control/RoadBlocks.h b/src/control/RoadBlocks.h
index 16e3a362..0f0c1882 100644
--- a/src/control/RoadBlocks.h
+++ b/src/control/RoadBlocks.h
@@ -6,9 +6,9 @@ class CVehicle;
class CRoadBlocks
{
public:
- static int16 (&NumRoadBlocks);
- static int16 (&RoadBlockObjects)[NUMROADBLOCKS];
- static bool (&InOrOut)[NUMROADBLOCKS];
+ static int16 NumRoadBlocks;
+ static int16 RoadBlockObjects[NUMROADBLOCKS];
+ static bool InOrOut[NUMROADBLOCKS];
static void Init(void);
static void GenerateRoadBlockCopsForCar(CVehicle* pVehicle, int32 roadBlockType, int16 roadBlockNode);
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index 428ac66a..d4ede846 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -87,47 +87,47 @@
#define FEET_IN_METER 3.33f
#endif
-uint8 (&CTheScripts::ScriptSpace)[SIZE_SCRIPT_SPACE] = *(uint8(*)[SIZE_SCRIPT_SPACE])*(uintptr*)0x74B248;
-CRunningScript(&CTheScripts::ScriptsArray)[MAX_NUM_SCRIPTS] = *(CRunningScript(*)[MAX_NUM_SCRIPTS])*(uintptr*)0x6F5C08;
-int32(&CTheScripts::BaseBriefIdForContact)[MAX_NUM_CONTACTS] = *(int32(*)[MAX_NUM_CONTACTS])*(uintptr*)0x880200;
-int32(&CTheScripts::OnAMissionForContactFlag)[MAX_NUM_CONTACTS] = *(int32(*)[MAX_NUM_CONTACTS])*(uintptr*)0x8622F0;
-intro_text_line (&CTheScripts::IntroTextLines)[MAX_NUM_INTRO_TEXT_LINES] = *(intro_text_line (*)[MAX_NUM_INTRO_TEXT_LINES])*(uintptr*)0x70EA68;
-intro_script_rectangle (&CTheScripts::IntroRectangles)[MAX_NUM_INTRO_RECTANGLES] = *(intro_script_rectangle (*)[MAX_NUM_INTRO_RECTANGLES])*(uintptr*)0x72D108;
-CSprite2d (&CTheScripts::ScriptSprites)[MAX_NUM_SCRIPT_SRPITES] = *(CSprite2d(*)[MAX_NUM_SCRIPT_SRPITES])*(uintptr*)0x72B090;
-script_sphere_struct(&CTheScripts::ScriptSphereArray)[MAX_NUM_SCRIPT_SPHERES] = *(script_sphere_struct(*)[MAX_NUM_SCRIPT_SPHERES])*(uintptr*)0x727D60;
-tCollectiveData(&CTheScripts::CollectiveArray)[MAX_NUM_COLLECTIVES] = *(tCollectiveData(*)[MAX_NUM_COLLECTIVES])*(uintptr*)0x6FA008;
-tUsedObject(&CTheScripts::UsedObjectArray)[MAX_NUM_USED_OBJECTS] = *(tUsedObject(*)[MAX_NUM_USED_OBJECTS])*(uintptr*)0x6E69C8;
-int32(&CTheScripts::MultiScriptArray)[MAX_NUM_MISSION_SCRIPTS] = *(int32(*)[MAX_NUM_MISSION_SCRIPTS])*(uintptr*)0x6F0558;
-tBuildingSwap(&CTheScripts::BuildingSwapArray)[MAX_NUM_BUILDING_SWAPS] = *(tBuildingSwap(*)[MAX_NUM_BUILDING_SWAPS])*(uintptr*)0x880E30;
-CEntity*(&CTheScripts::InvisibilitySettingArray)[MAX_NUM_INVISIBILITY_SETTINGS] = *(CEntity*(*)[MAX_NUM_INVISIBILITY_SETTINGS])*(uintptr*)0x8620F0;
-CStoredLine (&CTheScripts::aStoredLines)[MAX_NUM_STORED_LINES] = *(CStoredLine(*)[MAX_NUM_STORED_LINES])*(uintptr*)0x743018;
-bool &CTheScripts::DbgFlag = *(bool*)0x95CD87;
-uint32 &CTheScripts::OnAMissionFlag = *(uint32*)0x8F1B64;
-int32 &CTheScripts::StoreVehicleIndex = *(int32*)0x8F5F3C;
-bool &CTheScripts::StoreVehicleWasRandom = *(bool*)0x95CDBC;
-CRunningScript *&CTheScripts::pIdleScripts = *(CRunningScript**)0x9430D4;
-CRunningScript *&CTheScripts::pActiveScripts = *(CRunningScript**)0x8E2BF4;
-uint32 &CTheScripts::NextFreeCollectiveIndex = *(uint32*)0x942F98;
-int32 &CTheScripts::LastRandomPedId = *(int32*)0x8F251C;
-uint16 &CTheScripts::NumberOfUsedObjects = *(uint16*)0x95CC72;
-bool &CTheScripts::bAlreadyRunningAMissionScript = *(bool*)0x95CDB3;
-bool &CTheScripts::bUsingAMultiScriptFile = *(bool*)0x95CD55;
-uint16 &CTheScripts::NumberOfMissionScripts = *(uint16*)0x95CC9A;
-uint32 &CTheScripts::LargestMissionScriptSize = *(uint32*)0x9414C8;
-uint32 &CTheScripts::MainScriptSize = *(uint32*)0x9405A4;
-uint8 &CTheScripts::FailCurrentMission = *(uint8*)0x95CD41;
-uint8 &CTheScripts::CountdownToMakePlayerUnsafe = *(uint8*)0x95CD51;
-uint8 &CTheScripts::DelayMakingPlayerUnsafeThisTime = *(uint8*)0x95CD88;
-uint16 &CTheScripts::NumScriptDebugLines = *(uint16*)0x95CC42;
-uint16 &CTheScripts::NumberOfIntroRectanglesThisFrame = *(uint16*)0x95CC88;
-uint16 &CTheScripts::NumberOfIntroTextLinesThisFrame = *(uint16*)0x95CC32;
-uint8 &CTheScripts::UseTextCommands = *(uint8*)0x95CD57;
-CMissionCleanup (&CTheScripts::MissionCleanup) = *(CMissionCleanup*)0x8F2A24;
-CUpsideDownCarCheck (&CTheScripts::UpsideDownCars) = *(CUpsideDownCarCheck*)0x6EE450;
-CStuckCarCheck (&CTheScripts::StuckCars) = *(CStuckCarCheck*)0x87C588;
-uint16 &CTheScripts::CommandsExecuted = *(uint16*)0x95CCA6;
-uint16 &CTheScripts::ScriptsUpdated = *(uint16*)0x95CC5E;
-int32(&ScriptParams)[32] = *(int32(*)[32])*(uintptr*)0x6ED460;
+uint8 CTheScripts::ScriptSpace[SIZE_SCRIPT_SPACE];
+CRunningScript CTheScripts::ScriptsArray[MAX_NUM_SCRIPTS];
+int32 CTheScripts::BaseBriefIdForContact[MAX_NUM_CONTACTS];
+int32 CTheScripts::OnAMissionForContactFlag[MAX_NUM_CONTACTS];
+intro_text_line CTheScripts::IntroTextLines[MAX_NUM_INTRO_TEXT_LINES];
+intro_script_rectangle CTheScripts::IntroRectangles[MAX_NUM_INTRO_RECTANGLES];
+CSprite2d CTheScripts::ScriptSprites[MAX_NUM_SCRIPT_SRPITES];
+script_sphere_struct CTheScripts::ScriptSphereArray[MAX_NUM_SCRIPT_SPHERES];
+tCollectiveData CTheScripts::CollectiveArray[MAX_NUM_COLLECTIVES];
+tUsedObject CTheScripts::UsedObjectArray[MAX_NUM_USED_OBJECTS];
+int32 CTheScripts::MultiScriptArray[MAX_NUM_MISSION_SCRIPTS];
+tBuildingSwap CTheScripts::BuildingSwapArray[MAX_NUM_BUILDING_SWAPS];
+CEntity* CTheScripts::InvisibilitySettingArray[MAX_NUM_INVISIBILITY_SETTINGS];
+CStoredLine CTheScripts::aStoredLines[MAX_NUM_STORED_LINES];
+bool CTheScripts::DbgFlag;
+uint32 CTheScripts::OnAMissionFlag;
+int32 CTheScripts::StoreVehicleIndex;
+bool CTheScripts::StoreVehicleWasRandom;
+CRunningScript *CTheScripts::pIdleScripts;
+CRunningScript *CTheScripts::pActiveScripts;
+uint32 CTheScripts::NextFreeCollectiveIndex;
+int32 CTheScripts::LastRandomPedId;
+uint16 CTheScripts::NumberOfUsedObjects;
+bool CTheScripts::bAlreadyRunningAMissionScript;
+bool CTheScripts::bUsingAMultiScriptFile;
+uint16 CTheScripts::NumberOfMissionScripts;
+uint32 CTheScripts::LargestMissionScriptSize;
+uint32 CTheScripts::MainScriptSize;
+uint8 CTheScripts::FailCurrentMission;
+uint8 CTheScripts::CountdownToMakePlayerUnsafe;
+uint8 CTheScripts::DelayMakingPlayerUnsafeThisTime;
+uint16 CTheScripts::NumScriptDebugLines;
+uint16 CTheScripts::NumberOfIntroRectanglesThisFrame;
+uint16 CTheScripts::NumberOfIntroTextLinesThisFrame;
+uint8 CTheScripts::UseTextCommands;
+CMissionCleanup CTheScripts::MissionCleanup;
+CUpsideDownCarCheck CTheScripts::UpsideDownCars;
+CStuckCarCheck CTheScripts::StuckCars;
+uint16 CTheScripts::CommandsExecuted;
+uint16 CTheScripts::ScriptsUpdated;
+int32 ScriptParams[32];
CMissionCleanup::CMissionCleanup()
{
diff --git a/src/control/Script.h b/src/control/Script.h
index 4338bd18..2eed29fe 100644
--- a/src/control/Script.h
+++ b/src/control/Script.h
@@ -240,46 +240,46 @@ enum {
class CTheScripts
{
- static uint8(&ScriptSpace)[SIZE_SCRIPT_SPACE];
- static CRunningScript(&ScriptsArray)[MAX_NUM_SCRIPTS];
- static int32(&BaseBriefIdForContact)[MAX_NUM_CONTACTS];
- static int32(&OnAMissionForContactFlag)[MAX_NUM_CONTACTS];
- static intro_text_line(&IntroTextLines)[MAX_NUM_INTRO_TEXT_LINES];
- static intro_script_rectangle(&IntroRectangles)[MAX_NUM_INTRO_RECTANGLES];
- static CSprite2d(&ScriptSprites)[MAX_NUM_SCRIPT_SRPITES];
- static script_sphere_struct(&ScriptSphereArray)[MAX_NUM_SCRIPT_SPHERES];
- static tCollectiveData(&CollectiveArray)[MAX_NUM_COLLECTIVES];
- static tUsedObject(&UsedObjectArray)[MAX_NUM_USED_OBJECTS];
- static int32(&MultiScriptArray)[MAX_NUM_MISSION_SCRIPTS];
- static tBuildingSwap(&BuildingSwapArray)[MAX_NUM_BUILDING_SWAPS];
- static CEntity*(&InvisibilitySettingArray)[MAX_NUM_INVISIBILITY_SETTINGS];
- static CStoredLine(&aStoredLines)[MAX_NUM_STORED_LINES];
- static bool &DbgFlag;
- static uint32 &OnAMissionFlag;
- static CMissionCleanup &MissionCleanup;
- static CStuckCarCheck &StuckCars;
- static CUpsideDownCarCheck &UpsideDownCars;
- static int32 &StoreVehicleIndex;
- static bool &StoreVehicleWasRandom;
- static CRunningScript *&pIdleScripts;
- static CRunningScript *&pActiveScripts;
- static uint32 &NextFreeCollectiveIndex;
- static int32 &LastRandomPedId;
- static uint16 &NumberOfUsedObjects;
- static bool &bAlreadyRunningAMissionScript;
- static bool &bUsingAMultiScriptFile;
- static uint16 &NumberOfMissionScripts;
- static uint32 &LargestMissionScriptSize;
- static uint32 &MainScriptSize;
- static uint8 &FailCurrentMission;
- static uint8 &CountdownToMakePlayerUnsafe;
- static uint8 &DelayMakingPlayerUnsafeThisTime;
- static uint16 &NumScriptDebugLines;
- static uint16 &NumberOfIntroRectanglesThisFrame;
- static uint16 &NumberOfIntroTextLinesThisFrame;
- static uint8 &UseTextCommands;
- static uint16 &CommandsExecuted;
- static uint16 &ScriptsUpdated;
+ static uint8 ScriptSpace[SIZE_SCRIPT_SPACE];
+ static CRunningScript ScriptsArray[MAX_NUM_SCRIPTS];
+ static int32 BaseBriefIdForContact[MAX_NUM_CONTACTS];
+ static int32 OnAMissionForContactFlag[MAX_NUM_CONTACTS];
+ static intro_text_line IntroTextLines[MAX_NUM_INTRO_TEXT_LINES];
+ static intro_script_rectangle IntroRectangles[MAX_NUM_INTRO_RECTANGLES];
+ static CSprite2d ScriptSprites[MAX_NUM_SCRIPT_SRPITES];
+ static script_sphere_struct ScriptSphereArray[MAX_NUM_SCRIPT_SPHERES];
+ static tCollectiveData CollectiveArray[MAX_NUM_COLLECTIVES];
+ static tUsedObject UsedObjectArray[MAX_NUM_USED_OBJECTS];
+ static int32 MultiScriptArray[MAX_NUM_MISSION_SCRIPTS];
+ static tBuildingSwap BuildingSwapArray[MAX_NUM_BUILDING_SWAPS];
+ static CEntity* InvisibilitySettingArray[MAX_NUM_INVISIBILITY_SETTINGS];
+ static CStoredLine aStoredLines[MAX_NUM_STORED_LINES];
+ static bool DbgFlag;
+ static uint32 OnAMissionFlag;
+ static CMissionCleanup MissionCleanup;
+ static CStuckCarCheck StuckCars;
+ static CUpsideDownCarCheck UpsideDownCars;
+ static int32 StoreVehicleIndex;
+ static bool StoreVehicleWasRandom;
+ static CRunningScript *pIdleScripts;
+ static CRunningScript *pActiveScripts;
+ static uint32 NextFreeCollectiveIndex;
+ static int32 LastRandomPedId;
+ static uint16 NumberOfUsedObjects;
+ static bool bAlreadyRunningAMissionScript;
+ static bool bUsingAMultiScriptFile;
+ static uint16 NumberOfMissionScripts;
+ static uint32 LargestMissionScriptSize;
+ static uint32 MainScriptSize;
+ static uint8 FailCurrentMission;
+ static uint8 CountdownToMakePlayerUnsafe;
+ static uint8 DelayMakingPlayerUnsafeThisTime;
+ static uint16 NumScriptDebugLines;
+ static uint16 NumberOfIntroRectanglesThisFrame;
+ static uint16 NumberOfIntroTextLinesThisFrame;
+ static uint8 UseTextCommands;
+ static uint16 CommandsExecuted;
+ static uint16 ScriptsUpdated;
public:
static void Init();