jamespetts/simutrans-experimental — pull request #18 by pipcet (2014-08-16 19:30:01+00:00)
Title: FIX: minor bugs in the city road removal code

James,
there were a few minor bugs in the checks we perform before deleting city roads:
* get_ribi() > 2 doesn't guarantee more than one ribi bit is actually set--the ribis might be 4 or 8.
* gr was shadowed by a locally-scoped variable
* we didn't allow deleting a "double cul-de-sac" like this:
hhh
shs
hhh

The consequence was you could delete most cities' road network if you started in the northeast and worked your way forward from there.

This patch (against the way-improvements branch which I gather is the currently active one) also moves the code to avoid duplication and makes city roads be public right of ways, which enables the diversionary route check, which I think is more realistic than being able to delete your city centre intersection because the rest of the road network is still connected.

I've tested it a little, and I think it should be fine.