src/ai/api/ai_vehicle.cpp
branchnoai
changeset 11000 51305152af09
parent 10999 f238f608f45c
child 11029 776c7cc8bda5
equal deleted inserted replaced
10999:f238f608f45c 11000:51305152af09
   198 
   198 
   199 	const Vehicle *v = ::GetVehicle(vehicle_id);
   199 	const Vehicle *v = ::GetVehicle(vehicle_id);
   200 	byte vehstatus = v->vehstatus;
   200 	byte vehstatus = v->vehstatus;
   201 
   201 
   202 	if (vehstatus & ::VS_CRASHED) return AIVehicle::VS_CRASHED;
   202 	if (vehstatus & ::VS_CRASHED) return AIVehicle::VS_CRASHED;
   203 	if (vehstatus & ::VS_BROKEN) return AIVehicle::VS_BROKEN;
   203 	if (v->breakdown_ctr != 0) return AIVehicle::VS_BROKEN;
   204 	if (v->IsStoppedInDepot()) return AIVehicle::VS_IN_DEPOT;
   204 	if (v->IsStoppedInDepot()) return AIVehicle::VS_IN_DEPOT;
   205 	if (vehstatus & ::VS_STOPPED) return AIVehicle::VS_STOPPED;
   205 	if (vehstatus & ::VS_STOPPED) return AIVehicle::VS_STOPPED;
   206 	if (v->current_order.IsType(OT_LOADING)) return AIVehicle::VS_AT_STATION;
   206 	if (v->current_order.IsType(OT_LOADING)) return AIVehicle::VS_AT_STATION;
   207 	return AIVehicle::VS_RUNNING;
   207 	return AIVehicle::VS_RUNNING;
   208 }
   208 }