diff options
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; |