1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-11-10 18:09:16 +00:00

final fix

This commit is contained in:
Nikolay Korolev 2020-05-08 11:49:40 +03:00
parent 09dc1f9e1e
commit db26700352

View file

@ -328,44 +328,6 @@ CCarCtrl::GenerateOneRandomCar()
pVehicle->AutoPilot.m_nCurrentRouteNode = curNodeId; pVehicle->AutoPilot.m_nCurrentRouteNode = curNodeId;
pVehicle->AutoPilot.m_nNextRouteNode = nextNodeId; pVehicle->AutoPilot.m_nNextRouteNode = nextNodeId;
switch (carClass) { 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: case COPS:
pVehicle->AutoPilot.m_nTempAction = TEMPACT_NONE; pVehicle->AutoPilot.m_nTempAction = TEMPACT_NONE;
if (CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_pWanted->m_nWantedLevel != 0){ if (CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_pWanted->m_nWantedLevel != 0){
@ -392,6 +354,19 @@ CCarCtrl::GenerateOneRandomCar()
pVehicle->AutoPilot.m_nCarMission = CCarAI::FindPoliceBoatMissionForWantedLevel(); pVehicle->AutoPilot.m_nCarMission = CCarAI::FindPoliceBoatMissionForWantedLevel();
break; break;
default: 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; break;
} }
if (pVehicle && pVehicle->GetModelIndex() == MI_MRWHOOP) if (pVehicle && pVehicle->GetModelIndex() == MI_MRWHOOP)
@ -526,29 +501,6 @@ CCarCtrl::GenerateOneRandomCar()
CVector2D speedDifferenceWithTarget = (CVector2D)pVehicle->GetMoveSpeed() - vecPlayerSpeed; CVector2D speedDifferenceWithTarget = (CVector2D)pVehicle->GetMoveSpeed() - vecPlayerSpeed;
CVector2D distanceToTarget = positionIncludingCurve - vecTargetPos; CVector2D distanceToTarget = positionIncludingCurve - vecTargetPos;
switch (carClass) { 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: case COPS:
pVehicle->SetStatus((pVehicle->AutoPilot.m_nCarMission == MISSION_CRUISE) ? STATUS_SIMPLE : STATUS_PHYSICS); pVehicle->SetStatus((pVehicle->AutoPilot.m_nCarMission == MISSION_CRUISE) ? STATUS_SIMPLE : STATUS_PHYSICS);
pVehicle->ChangeLawEnforcerState(1); pVehicle->ChangeLawEnforcerState(1);
@ -557,6 +509,7 @@ CCarCtrl::GenerateOneRandomCar()
pVehicle->ChangeLawEnforcerState(1); pVehicle->ChangeLawEnforcerState(1);
pVehicle->SetStatus(STATUS_PHYSICS); pVehicle->SetStatus(STATUS_PHYSICS);
default: default:
pVehicle->SetStatus(STATUS_SIMPLE);
break; break;
} }
CVisibilityPlugins::SetClumpAlpha(pVehicle->GetClump(), 0); CVisibilityPlugins::SetClumpAlpha(pVehicle->GetClump(), 0);