News:

Simutrans Sites
Know our official sites. Find tools and resources for Simutrans.

Bug and fix - crashes when deleting signs using the way removal tool

Started by jamespetts, February 11, 2013, 12:20:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jamespetts

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 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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

prissi

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.