1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-12-24 12:40:01 +00:00

fixed bugs

This commit is contained in:
Nikolay Korolev 2019-10-08 23:57:21 +03:00
parent e10f5ee6a3
commit 4b4e5abffd

View file

@ -28,6 +28,8 @@ float CCarAI::FindSwitchDistanceFar(CVehicle* pVehicle)
void CCarAI::UpdateCarAI(CVehicle* pVehicle) void CCarAI::UpdateCarAI(CVehicle* pVehicle)
{ {
//((void(*)(CVehicle*))(0x413E50))(pVehicle);
//return;
if (pVehicle->bIsLawEnforcer){ if (pVehicle->bIsLawEnforcer){
if (pVehicle->AutoPilot.m_nCarMission == MISSION_BLOCKCAR_FARAWAY || if (pVehicle->AutoPilot.m_nCarMission == MISSION_BLOCKCAR_FARAWAY ||
pVehicle->AutoPilot.m_nCarMission == MISSION_RAMPLAYER_FARAWAY || pVehicle->AutoPilot.m_nCarMission == MISSION_RAMPLAYER_FARAWAY ||
@ -101,13 +103,12 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
pVehicle->m_bSirenOrAlarm = false; pVehicle->m_bSirenOrAlarm = false;
} }
} }
else{ }
if (CCarCtrl::JoinCarWithRoadSystemGotoCoors(pVehicle, FindPlayerCoors(), true)){ else if (!CCarCtrl::JoinCarWithRoadSystemGotoCoors(pVehicle, FindPlayerCoors(), true)){
pVehicle->AutoPilot.m_nCarMission = MISSION_RAMPLAYER_FARAWAY; pVehicle->AutoPilot.m_nCarMission = MISSION_RAMPLAYER_FARAWAY;
pVehicle->m_bSirenOrAlarm = false; pVehicle->m_bSirenOrAlarm = false;
pVehicle->m_nCarHornTimer = 0; pVehicle->m_nCarHornTimer = 0;
} }
}
if (FindPlayerPed()->m_pWanted->m_bIgnoredByEveryone || pVehicle->bIsLawEnforcer && if (FindPlayerPed()->m_pWanted->m_bIgnoredByEveryone || pVehicle->bIsLawEnforcer &&
(FindPlayerPed()->m_pWanted->m_nWantedLevel == 0 || FindPlayerPed()->m_pWanted->m_bIgnoredByCops || CCullZones::NoPolice())){ (FindPlayerPed()->m_pWanted->m_nWantedLevel == 0 || FindPlayerPed()->m_pWanted->m_bIgnoredByCops || CCullZones::NoPolice())){
CCarCtrl::JoinCarWithRoadSystem(pVehicle); CCarCtrl::JoinCarWithRoadSystem(pVehicle);
@ -118,7 +119,6 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
} }
else if (pVehicle->bIsLawEnforcer) else if (pVehicle->bIsLawEnforcer)
MellowOutChaseSpeed(pVehicle); MellowOutChaseSpeed(pVehicle);
}
break; break;
case MISSION_BLOCKPLAYER_FARAWAY: case MISSION_BLOCKPLAYER_FARAWAY:
if (FindSwitchDistanceClose(pVehicle) > (FindPlayerCoors() - pVehicle->GetPosition()).Magnitude2D() || if (FindSwitchDistanceClose(pVehicle) > (FindPlayerCoors() - pVehicle->GetPosition()).Magnitude2D() ||
@ -139,7 +139,6 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
case MISSION_BLOCKPLAYER_CLOSE: case MISSION_BLOCKPLAYER_CLOSE:
if (FindSwitchDistanceFar(pVehicle) < (FindPlayerCoors() - pVehicle->GetPosition()).Magnitude2D() || if (FindSwitchDistanceFar(pVehicle) < (FindPlayerCoors() - pVehicle->GetPosition()).Magnitude2D() ||
pVehicle->AutoPilot.m_bIgnorePathfinding) { pVehicle->AutoPilot.m_bIgnorePathfinding) {
if (FindPlayerVehicle()) {
if (FindPlayerVehicle() && FindPlayerVehicle()->GetMoveSpeed().Magnitude() < 0.05f) if (FindPlayerVehicle() && FindPlayerVehicle()->GetMoveSpeed().Magnitude() < 0.05f)
#ifdef FIX_BUGS #ifdef FIX_BUGS
pVehicle->m_nTimeBlocked += CTimer::GetTimeStepInMilliseconds(); pVehicle->m_nTimeBlocked += CTimer::GetTimeStepInMilliseconds();
@ -160,13 +159,11 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
pVehicle->m_bSirenOrAlarm = false; pVehicle->m_bSirenOrAlarm = false;
} }
} }
else { }else if (!CCarCtrl::JoinCarWithRoadSystemGotoCoors(pVehicle, FindPlayerCoors(), true)) {
if (CCarCtrl::JoinCarWithRoadSystemGotoCoors(pVehicle, FindPlayerCoors(), true)) {
pVehicle->AutoPilot.m_nCarMission = MISSION_BLOCKPLAYER_FARAWAY; pVehicle->AutoPilot.m_nCarMission = MISSION_BLOCKPLAYER_FARAWAY;
pVehicle->m_bSirenOrAlarm = false; pVehicle->m_bSirenOrAlarm = false;
pVehicle->m_nCarHornTimer = 0; pVehicle->m_nCarHornTimer = 0;
} }
}
if (FindPlayerPed()->m_pWanted->m_bIgnoredByEveryone || pVehicle->bIsLawEnforcer && if (FindPlayerPed()->m_pWanted->m_bIgnoredByEveryone || pVehicle->bIsLawEnforcer &&
(FindPlayerPed()->m_pWanted->m_nWantedLevel == 0 || FindPlayerPed()->m_pWanted->m_bIgnoredByCops || CCullZones::NoPolice())) { (FindPlayerPed()->m_pWanted->m_nWantedLevel == 0 || FindPlayerPed()->m_pWanted->m_bIgnoredByCops || CCullZones::NoPolice())) {
CCarCtrl::JoinCarWithRoadSystem(pVehicle); CCarCtrl::JoinCarWithRoadSystem(pVehicle);
@ -177,8 +174,6 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
} }
else if (pVehicle->bIsLawEnforcer) else if (pVehicle->bIsLawEnforcer)
MellowOutChaseSpeed(pVehicle); MellowOutChaseSpeed(pVehicle);
}
}
break; break;
case MISSION_GOTOCOORDS: case MISSION_GOTOCOORDS:
if ((pVehicle->AutoPilot.m_vecDestinationCoors - pVehicle->GetPosition()).Magnitude2D() < DISTANCE_TO_SWITCH_DISTANCE_GOTO || if ((pVehicle->AutoPilot.m_vecDestinationCoors - pVehicle->GetPosition()).Magnitude2D() < DISTANCE_TO_SWITCH_DISTANCE_GOTO ||