From 5b1ffb09124c7427b7efb421091179ddecc725c4 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Thu, 17 Oct 2019 00:53:25 +0300 Subject: Some CPool and CPools funcs, restoring original logic of pool lookup loops --- src/control/CarAI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/control/CarAI.cpp') diff --git a/src/control/CarAI.cpp b/src/control/CarAI.cpp index bb0c1ec3..b4dd8777 100644 --- a/src/control/CarAI.cpp +++ b/src/control/CarAI.cpp @@ -588,7 +588,7 @@ void CCarAI::MakeWayForCarWithSiren(CVehicle *pVehicle) CVector2D forward = pVehicle->GetMoveSpeed() / flatSpeed; float projection = flatSpeed * 45 + 20; int i = CPools::GetVehiclePool()->GetSize(); - while (i--) { + while (--i >= 0) { CVehicle* vehicle = CPools::GetVehiclePool()->GetSlot(i); if (!vehicle) continue; -- cgit v1.2.3 From 43866a4f7033fbb2ea1d515c037f291e0f377165 Mon Sep 17 00:00:00 2001 From: Filip Gawin Date: Sat, 12 Oct 2019 22:36:45 +0200 Subject: Fix rebasing --- src/control/CarAI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/control/CarAI.cpp') diff --git a/src/control/CarAI.cpp b/src/control/CarAI.cpp index b4dd8777..c2f2bb43 100644 --- a/src/control/CarAI.cpp +++ b/src/control/CarAI.cpp @@ -592,7 +592,7 @@ void CCarAI::MakeWayForCarWithSiren(CVehicle *pVehicle) CVehicle* vehicle = CPools::GetVehiclePool()->GetSlot(i); if (!vehicle) continue; - if (vehicle->m_vehType != VEHICLE_TYPE_CAR && vehicle->m_vehType != VEHICLE_TYPE_BIKE) + if (vehicle->m_vehType != VEHICLE_TYPE_AUTOMOBILE && vehicle->m_vehType != VEHICLE_TYPE_BIKE) continue; if (vehicle->m_status != STATUS_SIMPLE && vehicle->m_status != STATUS_PHYSICS) continue; -- cgit v1.2.3 From 8808e6fdfe5604022a64e72df3ee60d8ed10e9d6 Mon Sep 17 00:00:00 2001 From: Filip Gawin Date: Fri, 25 Oct 2019 18:39:26 +0200 Subject: Fixes for aap review (audio8) --- src/control/CarAI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/control/CarAI.cpp') diff --git a/src/control/CarAI.cpp b/src/control/CarAI.cpp index c2f2bb43..b4dd8777 100644 --- a/src/control/CarAI.cpp +++ b/src/control/CarAI.cpp @@ -592,7 +592,7 @@ void CCarAI::MakeWayForCarWithSiren(CVehicle *pVehicle) CVehicle* vehicle = CPools::GetVehiclePool()->GetSlot(i); if (!vehicle) continue; - if (vehicle->m_vehType != VEHICLE_TYPE_AUTOMOBILE && vehicle->m_vehType != VEHICLE_TYPE_BIKE) + if (vehicle->m_vehType != VEHICLE_TYPE_CAR && vehicle->m_vehType != VEHICLE_TYPE_BIKE) continue; if (vehicle->m_status != STATUS_SIMPLE && vehicle->m_status != STATUS_PHYSICS) continue; -- cgit v1.2.3