The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: jamespetts on February 11, 2013, 12:20:16 PM

Title: Bug and fix - crashes when deleting signs using the way removal tool
Post by: jamespetts on February 11, 2013, 12:20:16 PM
This issue has been reported, and now fixed, in Experimental, but my inspection of the Standard code shows that the problem may well be present there, too, although I have not had time to test it.

The problem occurred when a sign or signal was present on a way tile which was also a junction, and the way removal tool was used to remove the way going in one direction from that tile but not the way going in the other direction. When a sign or signal appeared on that tile, that sign or signal would be removed, too, but the count_signs() method would not be called on the remaining tile with the result that the has_sign() method would return true even though there is no sign on the tile, resulting in access violations/segmentation faults when a vehicle calculated its route and tried to check what sort of sign was present.

this (https://github.com/jamespetts/simutrans-experimental/commit/8d674bb2051504c1010079ce9133b283fa5460f5) fix should do it, by calling count_signs() on any way tiles left after deletion. My tests show that this prevents the crash in Experimental. Another option would be not to remove the sign in this case: consideration will have to be given as to whether this is the better behaviour.
Title: Re: Bug and fix - crashes when deleting signs using the way removal tool
Post by: prissi on February 11, 2013, 02:04:26 PM
Considering that signs or signals are not allowed on crossings (at least directional one will neither display nor work correct), full removal make sense for me.