From 4505b8795add8bdc9ee30aa9eb6ced6f8310ddc7 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Wed, 13 Jan 2021 01:37:25 +0300 Subject: fix --- src/control/Script4.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/control') diff --git a/src/control/Script4.cpp b/src/control/Script4.cpp index efe35efb..fa9a9d6a 100644 --- a/src/control/Script4.cpp +++ b/src/control/Script4.cpp @@ -1811,8 +1811,8 @@ int8 CRunningScript::ProcessCommands900To999(int32 command) return 0; int attempts; int model = -1; - int index = CGeneral::GetRandomNumberInRange(0, 50); - for (attempts = 0; attempts < 50; attempts++) { + int index = CGeneral::GetRandomNumberInRange(0, MAXVEHICLESLOADED); + for (attempts = 0; attempts < MAXVEHICLESLOADED; attempts++) { if (model != -1) break; model = CStreaming::ms_vehiclesLoaded[index]; -- cgit v1.2.3 From 232d990e6d76e52821a5cc69d51048a94ddec867 Mon Sep 17 00:00:00 2001 From: withmorten Date: Wed, 13 Jan 2021 00:18:58 +0100 Subject: move stuff back into class; securom comments --- src/control/Replay.cpp | 2 +- src/control/Replay.h | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'src/control') diff --git a/src/control/Replay.cpp b/src/control/Replay.cpp index 37a54999..db768e17 100644 --- a/src/control/Replay.cpp +++ b/src/control/Replay.cpp @@ -1729,7 +1729,7 @@ void CReplay::SaveReplayToHD(void) CFileMgr::SetDir(""); } -void PlayReplayFromHD(void) +void CReplay::PlayReplayFromHD(void) { CFileMgr::SetDirMyDocuments(); int fr = CFileMgr::OpenFile("replay.rep", "rb"); diff --git a/src/control/Replay.h b/src/control/Replay.h index 84a6bef0..5dd8b651 100644 --- a/src/control/Replay.h +++ b/src/control/Replay.h @@ -64,8 +64,6 @@ struct CStoredDetailedAnimationState uint8 aGroupId2[NUM_PARTIAL_ANIMS_IN_REPLAY]; }; -void PlayReplayFromHD(void); - #ifdef GTA_REPLAY #define REPLAY_STUB #else @@ -410,12 +408,10 @@ private: static void EmptyAllPools(void); static void MarkEverythingAsNew(void); static void SaveReplayToHD(void); + static void PlayReplayFromHD(void); // out of class in III PC and later because of SecuROM static void FindFirstFocusCoordinate(CVector *coord); static void ProcessLookAroundCam(void); static size_t FindSizeOfPacket(uint8); static void GoToNextBlock(void); - - /* Absolute nonsense, but how could this function end up being outside of class? */ - friend void PlayReplayFromHD(void); #endif }; -- cgit v1.2.3 From e122a75dd283b79fe5f5da742a8e11eab8730ec3 Mon Sep 17 00:00:00 2001 From: withmorten Date: Wed, 13 Jan 2021 00:28:51 +0100 Subject: more securom fixes --- src/control/Replay.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/control') diff --git a/src/control/Replay.cpp b/src/control/Replay.cpp index db768e17..e7e0ea8c 100644 --- a/src/control/Replay.cpp +++ b/src/control/Replay.cpp @@ -1748,17 +1748,17 @@ void CReplay::PlayReplayFromHD(void) return; } int slot; - for (slot = 0; CFileMgr::Read(fr, (char*)CReplay::Buffers[slot], sizeof(CReplay::Buffers[slot])); slot++) - CReplay::BufferStatus[slot] = CReplay::REPLAYBUFFER_PLAYBACK; - CReplay::BufferStatus[slot - 1] = CReplay::REPLAYBUFFER_RECORD; - while (slot < CReplay::NUM_REPLAYBUFFERS) - CReplay::BufferStatus[slot++] = CReplay::REPLAYBUFFER_UNUSED; + for (slot = 0; CFileMgr::Read(fr, (char*)Buffers[slot], sizeof(Buffers[slot])); slot++) + BufferStatus[slot] = REPLAYBUFFER_PLAYBACK; + BufferStatus[slot - 1] = REPLAYBUFFER_RECORD; + while (slot < NUM_REPLAYBUFFERS) + BufferStatus[slot++] = REPLAYBUFFER_UNUSED; CFileMgr::CloseFile(fr); CFileMgr::SetDir(""); - CReplay::TriggerPlayback(CReplay::REPLAYCAMMODE_ASSTORED, 0.0f, 0.0f, 0.0f, false); - CReplay::bPlayingBackFromFile = true; - CReplay::bAllowLookAroundCam = true; - CReplay::StreamAllNecessaryCarsAndPeds(); + TriggerPlayback(REPLAYCAMMODE_ASSTORED, 0.0f, 0.0f, 0.0f, false); + bPlayingBackFromFile = true; + bAllowLookAroundCam = true; + StreamAllNecessaryCarsAndPeds(); } void CReplay::StreamAllNecessaryCarsAndPeds(void) -- cgit v1.2.3 From e3a261d29cbb10abc0776ca697512349845a105c Mon Sep 17 00:00:00 2001 From: aap Date: Wed, 13 Jan 2021 13:01:20 +0100 Subject: rename m_vehEnterType -> m_vehDoor --- src/control/Script4.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/control') diff --git a/src/control/Script4.cpp b/src/control/Script4.cpp index fa9a9d6a..3c4860f7 100644 --- a/src/control/Script4.cpp +++ b/src/control/Script4.cpp @@ -792,20 +792,20 @@ int8 CRunningScript::ProcessCommands800To899(int32 command) }else{ pPed->m_pMyVehicle->RemovePassenger(pPed); } - if (pPed->m_vehEnterType) { + if (pPed->m_vehDoor) { if (pPed->GetPedState() == PED_EXIT_CAR || pPed->GetPedState() == PED_DRAG_FROM_CAR) { uint8 flags = 0; if (pPed->m_pMyVehicle->IsBike()) { - if (pPed->m_vehEnterType == CAR_DOOR_LF || - pPed->m_vehEnterType == CAR_DOOR_RF || - pPed->m_vehEnterType == CAR_WINDSCREEN) + if (pPed->m_vehDoor == CAR_DOOR_LF || + pPed->m_vehDoor == CAR_DOOR_RF || + pPed->m_vehDoor == CAR_WINDSCREEN) flags = CAR_DOOR_FLAG_LF | CAR_DOOR_FLAG_RF; - else if (pPed->m_vehEnterType == CAR_DOOR_LR || - pPed->m_vehEnterType == CAR_DOOR_RR) + else if (pPed->m_vehDoor == CAR_DOOR_LR || + pPed->m_vehDoor == CAR_DOOR_RR) flags = CAR_DOOR_FLAG_LR | CAR_DOOR_FLAG_RR; } else { - switch (pPed->m_vehEnterType) { + switch (pPed->m_vehDoor) { case CAR_DOOR_LF: flags = pPed->m_pMyVehicle->m_nNumMaxPassengers != 0 ? CAR_DOOR_FLAG_LF : CAR_DOOR_FLAG_LF | CAR_DOOR_FLAG_LR; break; @@ -821,7 +821,7 @@ int8 CRunningScript::ProcessCommands800To899(int32 command) } } pPed->m_pMyVehicle->m_nGettingOutFlags &= ~flags; - pPed->m_pMyVehicle->ProcessOpenDoor(pPed->m_vehEnterType, NUM_STD_ANIMS, 0.0f); + pPed->m_pMyVehicle->ProcessOpenDoor(pPed->m_vehDoor, NUM_STD_ANIMS, 0.0f); } } } -- cgit v1.2.3