Re: 8.x - crash when building elevated monorail
Reply #5 –
Ahh, right! I remember seeing a function that returned the ground tile from a 2d coordinate somewhere...
Here we go.
If you want that code block to also apply to elevated ways, in stead of wrapping it in the "if (gr) { ... } " as I did, you could prepend it with:
if (!gr) {
gr = welt->lookup_kartenboden(koord(route[i].x, route[i].y));
}
That should correctly obtain the ground tile from any elevation and display a discount if you own property on it. I'm not sure if the discount will be properly applied when actually purchasing the way though. The cost calculation chain is still quite opaque to me. Also, it will affect tunnels under the tile, which may not be desirable.