src/ai/api/ai_vehicle.cpp
branchnoai
changeset 10668 495789401303
parent 10389 a922e7213c8a
child 10999 f238f608f45c
equal deleted inserted replaced
10667:1bacf27342bd 10668:495789401303
   224 		case VEH_AIRCRAFT: return VEHICLE_AIR;
   224 		case VEH_AIRCRAFT: return VEHICLE_AIR;
   225 		default:           return VEHICLE_INVALID;
   225 		default:           return VEHICLE_INVALID;
   226 	}
   226 	}
   227 }
   227 }
   228 
   228 
       
   229 /* static */ AIRoad::RoadType AIVehicle::GetRoadType(VehicleID vehicle_id)
       
   230 {
       
   231 	if (!IsValidVehicle(vehicle_id)) return AIRoad::ROADTYPE_INVALID;
       
   232 	if (GetVehicleType(vehicle_id) != VEHICLE_ROAD) return AIRoad::ROADTYPE_INVALID;
       
   233 
       
   234 	return (AIRoad::RoadType)GetVehicle(vehicle_id)->u.road.roadtype;
       
   235 }
       
   236 
   229 /* static */ int32 AIVehicle::GetCapacity(VehicleID vehicle_id, CargoID cargo)
   237 /* static */ int32 AIVehicle::GetCapacity(VehicleID vehicle_id, CargoID cargo)
   230 {
   238 {
   231 	if (!IsValidVehicle(vehicle_id)) return -1;
   239 	if (!IsValidVehicle(vehicle_id)) return -1;
   232 	if (!AICargo::IsValidCargo(cargo)) return -1;
   240 	if (!AICargo::IsValidCargo(cargo)) return -1;
   233 
   241