From a5d6c952a7be243a4c20b6aad47116dce0e51625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?eray=20or=C3=A7unus?= Date: Sun, 27 Sep 2020 02:36:49 +0300 Subject: Credits & fixes --- src/control/RoadBlocks.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/control/RoadBlocks.cpp') 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; -- cgit v1.2.3