Hmm, your code doesn't compile because the part in simmain.cc has problems with arrays that aren't dynamic being treated as if they were in places such as:
uint16 river_len = tmp->count+1;
koord river_route[river_len];
The second line produces the errors:
error C2057: expected constant expression
error C2466: cannot allocate an array of constant size 0
error C2133: 'river_route' : unknown size
Edit: Have fixed it by changing the following lines (old lines are commented out):
//uint32 MAX_NODES = 200000;
const uint32 MAX_NODES = 200000;
ANode nodes[MAX_NODES];
uint16 river_len = tmp->count+1;
//koord river_route[river_len];
vector_tpl<koord> river_route(river_len);
//sint8 river_hgt[river_len];
vector_tpl<sint8> river_hgt(river_len);
river_hgt[0] = lookup_hgt(river_route[0]);
Edit 2: Unfortunately, the first change produces a stack overflow: an array of 2,000 ANode type is evidently too much for my CPU! I am trying to make it work with a vector, but get out of bounds errors at present...
Edit 3: I have finally managed to get it working by converting all instances thus:
//ANode* tmp = &nodes[step];
ANode* tmp = new ANode;
And all instances thus (and similar):
//river_hgt[0] = lookup_hgt(river_route[0]);
river_hgt.insert_at(0, lookup_hgt(river_route[0]));
At present, I only get a large, sea-level river hewn out of the landscape: no canal-based shallower rivers. Is that intentional? Also, no matter how many rivers that I set it to create (by changing the number in the argument "create_rivers(uint8 number)" to 5), it creates only one.
Edit 4: I have managed to get it to create the correct number of rivers using a for loop in the rivers creation method, although that slows map initialisation a little. Still cannot get shallow rivers to work.