The International Simutrans Forum

Simutrans Extended => Simutrans-Extended bug reports => Simutrans-Extended development => Simutrans-Extended closed bug reports => Topic started by: Mariculous on January 19, 2020, 12:22:21 PM

Title: [BUG] dragging signals can exceed signalboxes capacity
Post by: Mariculous on January 19, 2020, 12:22:21 PM
I just tried to reproduce another bug when I noticed this one.

What happened?
I just dragged a lot signals and they were all placed linking back to the signalbox, whilst the amount would exceed signalboxes capacity. Is seems these excessive signals are not linked back from the signalbox to the signal.

How to reproduce?
- Open the attached save and select the signalbox.
- Select the "stop signal (colur light) and set a small signal spacing e.g. 125.
- Drag signals along the existing rail.
- - You will now have many more signals than what the signalbox could controll.
- Randomly remove some signals.
- - you will see signalboxes counter will decrease for ones that were placed whilst there was still capacity, whilst the others won't decrease the counter.
- Delete the signalbox
- - you will see all signals that were placed whilst there was still capacity to get removes. The others will remain "Controlled from: none"
Title: Re: [BUG] dragging signals can exceed signalboxes capacity
Post by: jamespetts on January 19, 2020, 04:50:10 PM
Thank you for the report: I believe that I have now fixed this. I should be grateful if you could re-test with the next nightly build.
Title: Re: [BUG] dragging signals can exceed signalboxes capacity
Post by: freddyhayward on January 20, 2020, 09:04:20 AM
I'm not sure if this is the correct thread to post this in, but one recent change related to signalboxes caused a segfault when placing signals from signal_group=0 (i.e. one train staff). I have submitted a pull request that I believe fixes this.
Title: Re: [BUG] dragging signals can exceed signalboxes capacity
Post by: jamespetts on January 20, 2020, 11:11:04 AM
Thank you very much for that - now incorporated.
Title: Re: [BUG] dragging signals can exceed signalboxes capacity
Post by: Mariculous on January 20, 2020, 02:34:35 PM
Fixed.
As this is not calculated at drag time but later on at placement time, a mesage like
"Not all signaly were built successfully. Attempting to build n signal, but signalbox had only m slots left" would be splendid.

Did not compile the incorporated changes, so I can't confirm the crash to be fixed yet.