mirror of
https://git.rip/DMCA_FUCKER/re3.git
synced 2024-12-24 13:10:00 +00:00
CarCtrl fixes
This commit is contained in:
parent
e07b6fdce7
commit
a77b181e32
|
@ -1127,7 +1127,7 @@ CCarCtrl::FindMaximumSpeedForThisCarInTraffic(CVehicle* pVehicle)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pVehicle->bWarnedPeds = true;
|
pVehicle->bWarnedPeds = true;
|
||||||
if (pVehicle->AutoPilot.m_nDrivingStyle == DRIVINGSTYLE_STOP_FOR_CARS)
|
if (pVehicle->AutoPilot.m_nDrivingStyle == DRIVINGSTYLE_STOP_FOR_CARS || pVehicle->AutoPilot.m_nDrivingStyle == DRIVINGSTYLE_STOP_FOR_CARS_IGNORE_LIGHTS)
|
||||||
return maxSpeed;
|
return maxSpeed;
|
||||||
return (maxSpeed + pVehicle->AutoPilot.GetCruiseSpeed()) / 2;
|
return (maxSpeed + pVehicle->AutoPilot.GetCruiseSpeed()) / 2;
|
||||||
}
|
}
|
||||||
|
@ -1227,12 +1227,12 @@ void CCarCtrl::SlowCarDownForPedsSectorList(CPtrList& lst, CVehicle* pVehicle, f
|
||||||
if (dotVelocity * GAME_SPEED_TO_METERS_PER_SECOND / 2 > distanceUntilHit)
|
if (dotVelocity * GAME_SPEED_TO_METERS_PER_SECOND / 2 > distanceUntilHit)
|
||||||
pPed->SetEvasiveStep(pVehicle, 0);
|
pPed->SetEvasiveStep(pVehicle, 0);
|
||||||
}else if (dotVelocity > 0.3f) {
|
}else if (dotVelocity > 0.3f) {
|
||||||
if (sideLength - 0.5f < sidewaysDistance)
|
if (sideLength + 0.1f < sidewaysDistance)
|
||||||
pPed->SetEvasiveStep(pVehicle, 0);
|
pPed->SetEvasiveStep(pVehicle, 0);
|
||||||
else
|
else
|
||||||
pPed->SetEvasiveDive(pVehicle, 0);
|
pPed->SetEvasiveDive(pVehicle, 0);
|
||||||
}else{
|
}else if (dotVelocity > 0.1f) {
|
||||||
if (sideLength + 0.1f < sidewaysDistance)
|
if (sideLength - 0.5f < sidewaysDistance)
|
||||||
pPed->SetEvasiveStep(pVehicle, 0);
|
pPed->SetEvasiveStep(pVehicle, 0);
|
||||||
else
|
else
|
||||||
pPed->SetEvasiveDive(pVehicle, 0);
|
pPed->SetEvasiveDive(pVehicle, 0);
|
||||||
|
@ -1261,7 +1261,7 @@ void CCarCtrl::SlowCarDownForPedsSectorList(CPtrList& lst, CVehicle* pVehicle, f
|
||||||
CPlayerPed* pPlayerPed = (CPlayerPed*)pPed;
|
CPlayerPed* pPlayerPed = (CPlayerPed*)pPed;
|
||||||
if (pPlayerPed->IsPlayer() && dotDirection < frontSafe &&
|
if (pPlayerPed->IsPlayer() && dotDirection < frontSafe &&
|
||||||
pPlayerPed->IsPedInControl() &&
|
pPlayerPed->IsPedInControl() &&
|
||||||
pPlayerPed->m_fMoveSpeed < 0.1f && pPlayerPed->bIsLooking &&
|
pPlayerPed->m_fMoveSpeed < 1.0f && !pPlayerPed->bIsLooking &&
|
||||||
CTimer::GetTimeInMilliseconds() > pPlayerPed->m_lookTimer) {
|
CTimer::GetTimeInMilliseconds() > pPlayerPed->m_lookTimer) {
|
||||||
pPlayerPed->AnnoyPlayerPed(false);
|
pPlayerPed->AnnoyPlayerPed(false);
|
||||||
pPlayerPed->SetLookFlag(pVehicle, true);
|
pPlayerPed->SetLookFlag(pVehicle, true);
|
||||||
|
@ -2751,10 +2751,12 @@ void CCarCtrl::SteerAICarWithPhysicsFollowPath(CVehicle* pVehicle, float* pSwerv
|
||||||
if (PickNextNodeAccordingStrategy(pVehicle)) {
|
if (PickNextNodeAccordingStrategy(pVehicle)) {
|
||||||
switch (pVehicle->AutoPilot.m_nCarMission){
|
switch (pVehicle->AutoPilot.m_nCarMission){
|
||||||
case MISSION_GOTOCOORDS:
|
case MISSION_GOTOCOORDS:
|
||||||
|
pVehicle->AutoPilot.m_nCarMission = MISSION_GOTOCOORDS_STRAIGHT;
|
||||||
SteerAICarWithPhysicsHeadingForTarget(pVehicle, nil, pVehicle->AutoPilot.m_vecDestinationCoors.x,
|
SteerAICarWithPhysicsHeadingForTarget(pVehicle, nil, pVehicle->AutoPilot.m_vecDestinationCoors.x,
|
||||||
pVehicle->AutoPilot.m_vecDestinationCoors.y, pSwerve, pAccel, pBrake, pHandbrake);
|
pVehicle->AutoPilot.m_vecDestinationCoors.y, pSwerve, pAccel, pBrake, pHandbrake);
|
||||||
return;
|
return;
|
||||||
case MISSION_GOTOCOORDS_ACCURATE:
|
case MISSION_GOTOCOORDS_ACCURATE:
|
||||||
|
pVehicle->AutoPilot.m_nCarMission = MISSION_GOTO_COORDS_STRAIGHT_ACCURATE;
|
||||||
SteerAICarWithPhysicsHeadingForTarget(pVehicle, nil, pVehicle->AutoPilot.m_vecDestinationCoors.x,
|
SteerAICarWithPhysicsHeadingForTarget(pVehicle, nil, pVehicle->AutoPilot.m_vecDestinationCoors.x,
|
||||||
pVehicle->AutoPilot.m_vecDestinationCoors.y, pSwerve, pAccel, pBrake, pHandbrake);
|
pVehicle->AutoPilot.m_vecDestinationCoors.y, pSwerve, pAccel, pBrake, pHandbrake);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -2268,7 +2268,7 @@ int8 CRunningScript::ProcessCommands100To199(int32 command)
|
||||||
car->AutoPilot.m_nCarMission = MISSION_GOTOCOORDS;
|
car->AutoPilot.m_nCarMission = MISSION_GOTOCOORDS;
|
||||||
car->SetStatus(STATUS_PHYSICS);
|
car->SetStatus(STATUS_PHYSICS);
|
||||||
car->bEngineOn = true;
|
car->bEngineOn = true;
|
||||||
car->AutoPilot.m_nCruiseSpeed = Max(car->AutoPilot.m_nCruiseSpeed, 6);
|
car->AutoPilot.m_nCruiseSpeed = Max(1, car->AutoPilot.m_nCruiseSpeed);
|
||||||
car->AutoPilot.m_nAntiReverseTimer = CTimer::GetTimeInMilliseconds();
|
car->AutoPilot.m_nAntiReverseTimer = CTimer::GetTimeInMilliseconds();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue