mirror of
https://git.rip/DMCA_FUCKER/re3.git
synced 2024-12-23 07:10:01 +00:00
dont hardcode first vehicle ID; little fix for roadblocks
This commit is contained in:
parent
3895853fe7
commit
876e402d1e
|
@ -7989,7 +7989,7 @@ cAudioManager::ProcessVehicle(CVehicle *veh)
|
||||||
if (handling)
|
if (handling)
|
||||||
params.m_pTransmission = &handling->Transmission;
|
params.m_pTransmission = &handling->Transmission;
|
||||||
|
|
||||||
params.m_nIndex = veh->GetModelIndex() - 90;
|
params.m_nIndex = veh->GetModelIndex() - MI_FIRST_VEHICLE;
|
||||||
if (params.m_pVehicle->GetStatus() == STATUS_SIMPLE)
|
if (params.m_pVehicle->GetStatus() == STATUS_SIMPLE)
|
||||||
velChange = params.m_pVehicle->AutoPilot.m_fMaxTrafficSpeed * 0.02f;
|
velChange = params.m_pVehicle->AutoPilot.m_fMaxTrafficSpeed * 0.02f;
|
||||||
else
|
else
|
||||||
|
|
|
@ -79,8 +79,8 @@ CRoadBlocks::GenerateRoadBlockCopsForCar(CVehicle* pVehicle, int32 roadBlockType
|
||||||
if (copType == COP_STREET)
|
if (copType == COP_STREET)
|
||||||
pCopPed->SetCurrentWeapon(WEAPONTYPE_COLT45);
|
pCopPed->SetCurrentWeapon(WEAPONTYPE_COLT45);
|
||||||
CPedPlacement::FindZCoorForPed(&posForZ);
|
CPedPlacement::FindZCoorForPed(&posForZ);
|
||||||
pCopPed->m_matrix.GetPosition() = posForZ;
|
pCopPed->SetPosition(posForZ);
|
||||||
CVector vecSavedPos = pCopPed->m_matrix.GetPosition();
|
CVector vecSavedPos = pCopPed->GetPosition();
|
||||||
pCopPed->m_matrix.SetRotate(0.0f, 0.0f, -HALFPI);
|
pCopPed->m_matrix.SetRotate(0.0f, 0.0f, -HALFPI);
|
||||||
pCopPed->m_matrix.GetPosition() += vecSavedPos;
|
pCopPed->m_matrix.GetPosition() += vecSavedPos;
|
||||||
pCopPed->m_bIsDisabledCop = true;
|
pCopPed->m_bIsDisabledCop = true;
|
||||||
|
@ -133,8 +133,8 @@ CRoadBlocks::GenerateRoadBlocks(void)
|
||||||
float fModelRadius = 2.0f * pVehicleColModel->boundingSphere.radius + 0.25f;
|
float fModelRadius = 2.0f * pVehicleColModel->boundingSphere.radius + 0.25f;
|
||||||
int16 radius = (int16)(fMapObjectRadius / fModelRadius);
|
int16 radius = (int16)(fMapObjectRadius / fModelRadius);
|
||||||
if (radius > 0 && radius < 6) {
|
if (radius > 0 && radius < 6) {
|
||||||
CVector2D vecDistanceToCamera = TheCamera.GetPosition() - mapObject->m_matrix.GetPosition();
|
CVector2D vecDistanceToCamera = TheCamera.GetPosition() - mapObject->GetPosition();
|
||||||
float fDotProduct = DotProduct2D(vecDistanceToCamera, mapObject->m_matrix.GetUp());
|
float fDotProduct = DotProduct2D(vecDistanceToCamera, mapObject->GetForward());
|
||||||
float fOffset = 0.5f * fModelRadius * (float)(radius - 1);
|
float fOffset = 0.5f * fModelRadius * (float)(radius - 1);
|
||||||
for (int16 i = 0; i < radius; i++) {
|
for (int16 i = 0; i < radius; i++) {
|
||||||
uint8 nRoadblockType = fDotProduct < 0.0f;
|
uint8 nRoadblockType = fDotProduct < 0.0f;
|
||||||
|
@ -174,7 +174,7 @@ CRoadBlocks::GenerateRoadBlocks(void)
|
||||||
pVehicle->bExtendedRange = true;
|
pVehicle->bExtendedRange = true;
|
||||||
if (pVehicle->UsesSiren(pVehicle->GetModelIndex()) && CGeneral::GetRandomNumber() & 1)
|
if (pVehicle->UsesSiren(pVehicle->GetModelIndex()) && CGeneral::GetRandomNumber() & 1)
|
||||||
pVehicle->m_bSirenOrAlarm = true;
|
pVehicle->m_bSirenOrAlarm = true;
|
||||||
if (pVehicle->m_matrix.GetForward().z > 0.94f) {
|
if (pVehicle->GetForward().z > 0.94f) {
|
||||||
CVisibilityPlugins::SetClumpAlpha(pVehicle->GetClump(), 0);
|
CVisibilityPlugins::SetClumpAlpha(pVehicle->GetClump(), 0);
|
||||||
CWorld::Add(pVehicle);
|
CWorld::Add(pVehicle);
|
||||||
pVehicle->bCreateRoadBlockPeds = true;
|
pVehicle->bCreateRoadBlockPeds = true;
|
||||||
|
|
|
@ -255,7 +255,8 @@ enum
|
||||||
MI_BUSKER4,
|
MI_BUSKER4,
|
||||||
// three more peds possible
|
// three more peds possible
|
||||||
|
|
||||||
MI_LANDSTAL = 90,
|
MI_FIRST_VEHICLE = 90,
|
||||||
|
MI_LANDSTAL = MI_FIRST_VEHICLE,
|
||||||
MI_IDAHO,
|
MI_IDAHO,
|
||||||
MI_STINGER,
|
MI_STINGER,
|
||||||
MI_LINERUN,
|
MI_LINERUN,
|
||||||
|
|
Loading…
Reference in a new issue