News:

SimuTranslator
Make Simutrans speak your language.

r6646 pak64 - Crash when renovating cityhall

Started by z9999+, August 15, 2013, 02:21:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

z9999+

r6646 pak64
Crash when renovating cityhall

How to reproduce:
1. Build a new city on (0, x).  - For example: (0, 141)
2. Grow up this city with public 'Grow city' tool.

Result:
Crash.

simu.log

Message: wegbauer_t::route_fuer(): setting way type to 1025, besch=cobblestone_road, bruecke_besch=NULL, tunnel_besch=NULL
Message: check_bau_rathaus(): bev=1500, new=0 name=Appingby
Message: stadt_t::check_bau_rathaus(): delete townhall at (0,141)
Message: stadt_t::check_bau_rathaus(): fill empty spot at (0,141)
[code]

Ters

I suspect that the town hall relocation tool has some trouble dealing with being at the edge of the map. It isn't used to being able to be there. Didn't crash for me, but it did create an out-of-place slope where the town hall had been. The slope went down a level along the x-axis towards the edge of the map. Then again, bugs like this may not crash the program, or crash it some time later.

Update: The city must be two levels above water (or more) for it to crash.

Ters

The height may or may not have something to say. There is however an obvious missing check in simciy.cc related to multi-tile building support, which appears to be what crashed for me. It checks all neighboring tiles for a building, but doesn't first check if the tile exists at all. I've attached a tiny patch for this. It doesn't cure to odd slope, though, which may be unrelated.

kierongreen

Slopes will be because karte_t::get_neighbour_heights returns grundwasser for neighbours outside map. Easy way to reproduce problem is to build an attraction at the edge of the map where there are slopes then delete. Fixing.

kierongreen

Committed Ters' patch as part of a wider fix for the issue Ters identified with slopes at the edge of map.