diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2020-05-08 10:49:40 +0200 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2020-05-08 10:49:40 +0200 |
commit | db267003522c76cc16520afa5a178d370e6be030 (patch) | |
tree | 70be3e22307bc947702b0d12c7fc5fb802c3f1ef | |
parent | Merge remote-tracking branch 'upstream/miami' into miami (diff) | |
download | re3-db267003522c76cc16520afa5a178d370e6be030.tar re3-db267003522c76cc16520afa5a178d370e6be030.tar.gz re3-db267003522c76cc16520afa5a178d370e6be030.tar.bz2 re3-db267003522c76cc16520afa5a178d370e6be030.tar.lz re3-db267003522c76cc16520afa5a178d370e6be030.tar.xz re3-db267003522c76cc16520afa5a178d370e6be030.tar.zst re3-db267003522c76cc16520afa5a178d370e6be030.zip |
-rw-r--r-- | src/control/CarCtrl.cpp | 75 |
1 files changed, 14 insertions, 61 deletions
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp index 8b1c5887..ffa419c1 100644 --- a/src/control/CarCtrl.cpp +++ b/src/control/CarCtrl.cpp @@ -328,44 +328,6 @@ CCarCtrl::GenerateOneRandomCar() pVehicle->AutoPilot.m_nCurrentRouteNode = curNodeId; pVehicle->AutoPilot.m_nNextRouteNode = nextNodeId; switch (carClass) { - case POOR: - case RICH: - case EXEC: - case WORKER: - case BIG: - case TAXI: - // TODO(MIAMI): check this - case MOPED: - case MOTORBIKE: - case LEISUREBOAT: - case WORKERBOAT: - // - case MAFIA: - case TRIAD: - case DIABLO: - case YAKUZA: - case YARDIE: - case COLOMB: - case NINES: - case GANG8: - case GANG9: - { - pVehicle->AutoPilot.m_nCruiseSpeed = CGeneral::GetRandomNumberInRange(9, 14); - if (carClass == EXEC) - pVehicle->AutoPilot.m_nCruiseSpeed = CGeneral::GetRandomNumberInRange(12, 18); - else if (carClass == POOR) - pVehicle->AutoPilot.m_nCruiseSpeed = CGeneral::GetRandomNumberInRange(7, 10); - CVehicleModelInfo* pVehicleInfo = pVehicle->GetModelInfo(); - if (pVehicleInfo->GetColModel()->boundingBox.max.y - pVehicle->GetModelInfo()->GetColModel()->boundingBox.min.y > 10.0f || carClass == BIG) { - pVehicle->AutoPilot.m_nCruiseSpeed *= 3; - pVehicle->AutoPilot.m_nCruiseSpeed /= 4; - } - pVehicle->AutoPilot.m_fMaxTrafficSpeed = pVehicle->AutoPilot.m_nCruiseSpeed; - pVehicle->AutoPilot.m_nCarMission = MISSION_CRUISE; - pVehicle->AutoPilot.m_nTempAction = TEMPACT_NONE; - pVehicle->AutoPilot.m_nDrivingStyle = DRIVINGSTYLE_STOP_FOR_CARS; - break; - } case COPS: pVehicle->AutoPilot.m_nTempAction = TEMPACT_NONE; if (CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_pWanted->m_nWantedLevel != 0){ @@ -392,6 +354,19 @@ CCarCtrl::GenerateOneRandomCar() pVehicle->AutoPilot.m_nCarMission = CCarAI::FindPoliceBoatMissionForWantedLevel(); break; default: + pVehicle->AutoPilot.m_nCruiseSpeed = CGeneral::GetRandomNumberInRange(9, 14); + if (carClass == EXEC) + pVehicle->AutoPilot.m_nCruiseSpeed = CGeneral::GetRandomNumberInRange(12, 18); + else if (carClass == POOR) + pVehicle->AutoPilot.m_nCruiseSpeed = CGeneral::GetRandomNumberInRange(7, 10); + if (pVehicle->GetColModel()->boundingBox.max.y - pVehicle->GetColModel()->boundingBox.min.y > 10.0f || carClass == BIG) { + pVehicle->AutoPilot.m_nCruiseSpeed *= 3; + pVehicle->AutoPilot.m_nCruiseSpeed /= 4; + } + pVehicle->AutoPilot.m_fMaxTrafficSpeed = pVehicle->AutoPilot.m_nCruiseSpeed; + pVehicle->AutoPilot.m_nCarMission = MISSION_CRUISE; + pVehicle->AutoPilot.m_nTempAction = TEMPACT_NONE; + pVehicle->AutoPilot.m_nDrivingStyle = DRIVINGSTYLE_STOP_FOR_CARS; break; } if (pVehicle && pVehicle->GetModelIndex() == MI_MRWHOOP) @@ -526,29 +501,6 @@ CCarCtrl::GenerateOneRandomCar() CVector2D speedDifferenceWithTarget = (CVector2D)pVehicle->GetMoveSpeed() - vecPlayerSpeed; CVector2D distanceToTarget = positionIncludingCurve - vecTargetPos; switch (carClass) { - case POOR: - case RICH: - case EXEC: - case WORKER: - // TODO(MIAMI): check this - case MOPED: - case MOTORBIKE: - case LEISUREBOAT: - case WORKERBOAT: - // - case BIG: - case TAXI: - case MAFIA: - case TRIAD: - case DIABLO: - case YAKUZA: - case YARDIE: - case COLOMB: - case NINES: - case GANG8: - case GANG9: - pVehicle->SetStatus(STATUS_SIMPLE); - break; case COPS: pVehicle->SetStatus((pVehicle->AutoPilot.m_nCarMission == MISSION_CRUISE) ? STATUS_SIMPLE : STATUS_PHYSICS); pVehicle->ChangeLawEnforcerState(1); @@ -557,6 +509,7 @@ CCarCtrl::GenerateOneRandomCar() pVehicle->ChangeLawEnforcerState(1); pVehicle->SetStatus(STATUS_PHYSICS); default: + pVehicle->SetStatus(STATUS_SIMPLE); break; } CVisibilityPlugins::SetClumpAlpha(pVehicle->GetClump(), 0); |