diff options
-rw-r--r-- | src/control/CarCtrl.cpp | 10 | ||||
-rw-r--r-- | src/control/Record.cpp | 10 | ||||
-rw-r--r-- | src/control/Record.h | 2 | ||||
-rw-r--r-- | src/control/Script.h | 2 | ||||
-rw-r--r-- | src/core/Game.h | 3 | ||||
-rw-r--r-- | src/core/World.cpp | 8 | ||||
-rw-r--r-- | src/core/World.h | 2 |
7 files changed, 14 insertions, 23 deletions
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp index 627d7bad..520efe75 100644 --- a/src/control/CarCtrl.cpp +++ b/src/control/CarCtrl.cpp @@ -408,11 +408,6 @@ CCarCtrl::GenerateOneRandomCar() float directionNextLinkX; float directionNextLinkY; if (positionBetweenNodes < 0.5f) { - float currentPathLinkForwardX = pVehicle->AutoPilot.m_nCurrentDirection * ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nCurrentPathNodeInfo].GetDirX(); - float currentPathLinkForwardY = pVehicle->AutoPilot.m_nCurrentDirection * ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nCurrentPathNodeInfo].GetDirY(); - float nextPathLinkForwardX = pVehicle->AutoPilot.m_nNextDirection * ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nNextPathNodeInfo].GetDirX(); - float nextPathLinkForwardY = pVehicle->AutoPilot.m_nNextDirection * ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nNextPathNodeInfo].GetDirY(); - pCurrentLink = &ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nCurrentPathNodeInfo]; pNextLink = &ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nNextPathNodeInfo]; positionOnCurrentLinkIncludingLane = CVector( @@ -442,11 +437,6 @@ CCarCtrl::GenerateOneRandomCar() pVehicle->AutoPilot.m_nTimeEnteredCurve = CTimer::GetTimeInMilliseconds() - (uint32)((positionBetweenNodes - 0.5f) * pVehicle->AutoPilot.m_nTimeToSpendOnCurrentCurve); - float currentPathLinkForwardX = pVehicle->AutoPilot.m_nCurrentDirection * ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nCurrentPathNodeInfo].GetDirX(); - float currentPathLinkForwardY = pVehicle->AutoPilot.m_nCurrentDirection * ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nCurrentPathNodeInfo].GetDirY(); - float nextPathLinkForwardX = pVehicle->AutoPilot.m_nNextDirection * ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nNextPathNodeInfo].GetDirX(); - float nextPathLinkForwardY = pVehicle->AutoPilot.m_nNextDirection * ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nNextPathNodeInfo].GetDirY(); - pCurrentLink = &ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nCurrentPathNodeInfo]; pNextLink = &ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nNextPathNodeInfo]; positionOnCurrentLinkIncludingLane = CVector( diff --git a/src/control/Record.cpp b/src/control/Record.cpp index 8a23ffde..7f636ec2 100644 --- a/src/control/Record.cpp +++ b/src/control/Record.cpp @@ -391,15 +391,17 @@ void CRecordDataForChase::ProcessControlCars(void) } } -#if (defined(GTA_PS2) || defined(FIX_BUGS)) bool CRecordDataForChase::ShouldThisPadBeLeftAlone(uint8 pad) { // may be wrong - if (Status == STATE_NONE || Status == STATE_PLAYBACK) + if (Status == STATE_PLAYBACK_INIT) // this is useless but ps2 def checks if it's STATE_PLAYBACK_INIT return false; - return pad != 0; + + if (Status == STATE_RECORD) + return pad != 0; + + return false; } -#endif void CRecordDataForChase::GiveUsACar(int32 mi, CVector pos, float angle, CAutomobile** ppCar, uint8 colour1, uint8 colour2) { diff --git a/src/control/Record.h b/src/control/Record.h index 8b55b1f4..6a94c408 100644 --- a/src/control/Record.h +++ b/src/control/Record.h @@ -57,9 +57,7 @@ public: static void RestoreInfoForMatrix(CMatrix&, CCarStateEachFrame*); static void RestoreInfoForCar(CAutomobile*, CCarStateEachFrame*, bool); static void ProcessControlCars(void); -#if (defined(GTA_PS2) || defined(FIX_BUGS)) static bool ShouldThisPadBeLeftAlone(uint8 pad); -#endif static void GiveUsACar(int32, CVector, float, CAutomobile**, uint8, uint8); static void StartChaseScene(float); static void CleanUpChaseScene(void); diff --git a/src/control/Script.h b/src/control/Script.h index 12f3233f..7fc18727 100644 --- a/src/control/Script.h +++ b/src/control/Script.h @@ -396,7 +396,7 @@ private: friend class CRunningScript; friend class CHud; friend void CMissionCleanup::Process(); -#ifdef FIX_BUGS +#ifdef MISSION_REPLAY friend void RetryMission(int, int); #endif diff --git a/src/core/Game.h b/src/core/Game.h index 46e8fc68..b55793af 100644 --- a/src/core/Game.h +++ b/src/core/Game.h @@ -5,7 +5,8 @@ enum eLevelName { LEVEL_GENERIC = 0, LEVEL_INDUSTRIAL, LEVEL_COMMERCIAL, - LEVEL_SUBURBAN + LEVEL_SUBURBAN, + NUM_LEVELS }; class CGame diff --git a/src/core/World.cpp b/src/core/World.cpp index 0bc564ff..1c988894 100644 --- a/src/core/World.cpp +++ b/src/core/World.cpp @@ -33,7 +33,7 @@ CColPoint gaTempSphereColPoints[MAX_COLLISION_POINTS]; -CPtrList CWorld::ms_bigBuildingsList[4]; +CPtrList CWorld::ms_bigBuildingsList[NUM_LEVELS]; CPtrList CWorld::ms_listMovingEntityPtrs; CSector CWorld::ms_aSectors[NUMSECTORS_Y][NUMSECTORS_X]; uint16 CWorld::ms_nCurrentScanCode; @@ -1745,13 +1745,13 @@ CWorld::ShutDown(void) pSector->m_lists[ENTITYLIST_DUMMIES_OVERLAP].Flush(); #endif } - for(int32 i = 0; i < 4; i++) { - for(CPtrNode *pNode = GetBigBuildingList((eLevelName)i).first; pNode; pNode = pNode->next) { + for(int32 i = 0; i < NUM_LEVELS; i++) { + for(CPtrNode *pNode = ms_bigBuildingsList[i].first; pNode; pNode = pNode->next) { CEntity *pEntity = (CEntity *)pNode->item; // Maybe remove from world here? delete pEntity; } - GetBigBuildingList((eLevelName)i).Flush(); + ms_bigBuildingsList[i].Flush(); } for(int i = 0; i < NUMSECTORS_X * NUMSECTORS_Y; i++) { CSector *pSector = GetSector(i % NUMSECTORS_X, i / NUMSECTORS_Y); diff --git a/src/core/World.h b/src/core/World.h index 9465a914..197f3cee 100644 --- a/src/core/World.h +++ b/src/core/World.h @@ -55,7 +55,7 @@ struct CStoredCollPoly; class CWorld { - static CPtrList ms_bigBuildingsList[4]; + static CPtrList ms_bigBuildingsList[NUM_LEVELS]; static CPtrList ms_listMovingEntityPtrs; static CSector ms_aSectors[NUMSECTORS_Y][NUMSECTORS_X]; static uint16 ms_nCurrentScanCode; |