Amend prev commit about checks

This commit is contained in:
HeshamTB 2021-01-11 02:37:28 +03:00
parent 200c06bfac
commit 20cfeb268c

View File

@ -457,10 +457,7 @@ public class MakkahCity {
if (!vehicle.isArrivedToDest()) {
double factor = 1-(vehicle.getCurrentStreet().capcityPoint(vehicle.getCurrentLocation(),
vehicle.getCurrentLocation()+1000,vehicle)) ;
if (vehicle instanceof Bus) vehicle.move(Bus.MAX_FORWARD * factor );
else if (vehicle instanceof Sedan) vehicle.move(Sedan.MAX_FORWARD * factor );
else if (vehicle instanceof SUV) vehicle.move(SUV.MAX_FORWARD * factor );
else if (vehicle instanceof Truck) vehicle.move(Bus.MAX_FORWARD * factor );
vehicle.move(vehicle.getMaxSpeed()*factor);
}
}
}