The income is already fixed. And also connection of factories should work right, since I used the function welt->torus_dist, which calculates the distance of to coordinates on the torus.

One thing that doesn't work yet is wegbauer_t::calc_distance. It is easy, if you calculate routes from a single starting point to an initial end point. But if you consider several end points, some additional logic is needed.

And I think, there are some differences of koord(3d) left, which should be replaced by welt->koord_diff.