summaryrefslogtreecommitdiff
path: root/src/ai/api/ai_road.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ai/api/ai_road.cpp')
-rw-r--r--src/ai/api/ai_road.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ai/api/ai_road.cpp b/src/ai/api/ai_road.cpp
index 4cced8873..4cbce4a68 100644
--- a/src/ai/api/ai_road.cpp
+++ b/src/ai/api/ai_road.cpp
@@ -5,12 +5,18 @@
#include "ai_road.hpp"
#include "ai_map.hpp"
#include "ai_station.hpp"
+#include "ai_cargo.hpp"
#include "../../station_map.h"
#include "../../command_type.h"
#include "../../settings_type.h"
#include "../../company_func.h"
#include "../../script/squirrel_helper_type.hpp"
+/* static */ AIRoad::RoadVehicleType AIRoad::GetRoadVehicleTypeForCargo(CargoID cargo_type)
+{
+ return AICargo::HasCargoClass(cargo_type, AICargo::CC_PASSENGERS) ? ROADVEHTYPE_BUS : ROADVEHTYPE_TRUCK;
+}
+
/* static */ bool AIRoad::IsRoadTile(TileIndex tile)
{
if (!::IsValidTile(tile)) return false;