diff options
author | eray orçunus <erayorcunus@gmail.com> | 2020-09-27 01:36:49 +0200 |
---|---|---|
committer | eray orçunus <erayorcunus@gmail.com> | 2020-09-27 01:36:49 +0200 |
commit | a5d6c952a7be243a4c20b6aad47116dce0e51625 (patch) | |
tree | df4dd2067111b7c42038ca6189ac0ae6db11d9d6 /src/control/RoadBlocks.cpp | |
parent | Use enums in aVehicleSettings (diff) | |
download | re3-a5d6c952a7be243a4c20b6aad47116dce0e51625.tar re3-a5d6c952a7be243a4c20b6aad47116dce0e51625.tar.gz re3-a5d6c952a7be243a4c20b6aad47116dce0e51625.tar.bz2 re3-a5d6c952a7be243a4c20b6aad47116dce0e51625.tar.lz re3-a5d6c952a7be243a4c20b6aad47116dce0e51625.tar.xz re3-a5d6c952a7be243a4c20b6aad47116dce0e51625.tar.zst re3-a5d6c952a7be243a4c20b6aad47116dce0e51625.zip |
Diffstat (limited to 'src/control/RoadBlocks.cpp')
-rw-r--r-- | src/control/RoadBlocks.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/control/RoadBlocks.cpp b/src/control/RoadBlocks.cpp index e8630bde..e7831b82 100644 --- a/src/control/RoadBlocks.cpp +++ b/src/control/RoadBlocks.cpp @@ -92,10 +92,16 @@ CRoadBlocks::GenerateRoadBlockCopsForCar(CVehicle* pVehicle, int32 roadBlockType pCopPed->SetIdle(); pCopPed->bKindaStayInSamePlace = true; pCopPed->bNotAllowedToDuck = false; - pCopPed->bCrouchWhenShooting = roadBlockType != 2; + pCopPed->m_nExtendedRangeTimer = CTimer::GetTimeInMilliseconds() + 10000; + pCopPed->m_nRoadblockVeh = pVehicle; + pCopPed->m_nRoadblockVeh->RegisterReference((CEntity**)&pCopPed->m_nRoadblockVeh); + pCopPed->bCrouchWhenShooting = roadBlockType == 2 ? false : true; if (pEntityToAttack) { + if (pCopPed->m_pPointGunAt) + pCopPed->m_pPointGunAt->CleanUpOldReference(&pCopPed->m_pPointGunAt); pCopPed->m_pPointGunAt = pEntityToAttack; - pEntityToAttack->RegisterReference(&pCopPed->m_pPointGunAt); + if (pEntityToAttack) + pEntityToAttack->RegisterReference(&pCopPed->m_pPointGunAt); pCopPed->SetAttack(pEntityToAttack); } pCopPed->m_pMyVehicle = pVehicle; |