summaryrefslogtreecommitdiffstats
path: root/src/control/RoadBlocks.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-09-30 14:19:37 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-09-30 14:19:37 +0200
commit60681884533b79a08ed5574a257df7707d858a4d (patch)
tree76fd83d4b13d5d7c743acc57801b7b8e4fc4a795 /src/control/RoadBlocks.cpp
parentnow fixed properly (diff)
parentMerge pull request #721 from theR4K/miamiUpstream (diff)
downloadre3-60681884533b79a08ed5574a257df7707d858a4d.tar
re3-60681884533b79a08ed5574a257df7707d858a4d.tar.gz
re3-60681884533b79a08ed5574a257df7707d858a4d.tar.bz2
re3-60681884533b79a08ed5574a257df7707d858a4d.tar.lz
re3-60681884533b79a08ed5574a257df7707d858a4d.tar.xz
re3-60681884533b79a08ed5574a257df7707d858a4d.tar.zst
re3-60681884533b79a08ed5574a257df7707d858a4d.zip
Diffstat (limited to 'src/control/RoadBlocks.cpp')
-rw-r--r--src/control/RoadBlocks.cpp10
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;