[Fixed] Subtle bug in "Apply Line" in depot window April 27, 2010, 12:38:41 am This is occuring in -devel. It might have been occurring as early as 7.3, but it's intermittent.*Sometimes*, not always, when I hit "Apply Line" in the depot window to apply (say) Line 1 to a convoy, it will spontaneously create a new line (line 2) and pop up a "Line Management" dialogue to set the schedule for it. Line 1 *will* be applied to the convoy.This feels like accidental fallthrough in a case statement, frankly -- but it only happens sometimes! Quote Selected Last Edit: May 01, 2010, 04:10:38 pm by jamespetts
Re: Subtle bug in "Apply Line" in depot window Reply #1 – April 27, 2010, 10:43:21 am Hmm, the odd thing is that this is not code that has been affected by Simutrans-Experimental (although I have some recollection of Bernd merging some code from Standard that affected this area, pre 7.2...). Quote Selected
Re: Subtle bug in "Apply Line" in depot window Reply #2 – April 27, 2010, 07:16:35 pm Quote from: jamespetts – on April 27, 2010, 10:43:21 amHmm, the odd thing is that this is not code that has been affected by Simutrans-Experimental (although I have some recollection of Bernd merging some code from Standard that affected this area, pre 7.2...). Well, I can't say for sure that this doesn't occur in Standard! It occurs infrequently enough, and I play Standard infrequently enough, that it might.Can you point me to the right section of code? What routine gets triggered when you hit a button in a depot? Quote Selected
Re: Subtle bug in "Apply Line" in depot window Reply #3 – April 27, 2010, 09:15:22 pm Hmm, I can't even remember off the top of my head. I think that it's something like depot_frame_t::action_triggered()... Quote Selected
Re: Subtle bug in "Apply Line" in depot window Reply #4 – May 01, 2010, 02:20:44 am I figured this one out -- but I still don't know how to fix it. It is subtle.Under certain circumstances, hitting "Apply Line" causes the depot window to automatically change width -- to get wider. This happens when the constructed convoy is too wide for the window (due to having oodles of cars). When this happens, the width of the buttons also changes. If I pressed the mouse down on the left side of the Apply Line button, after the widening it is on the right side of the New Line button, and it proceeds to activate "New Line".This is a fundamental problem in the core UI code, which is simply exposed by the longer convoys allowed in experimental. I don't know exactly why it's doing this, but it seems to be triggering on mousedown instead of mouseup, or some such. Quote Selected
Re: Subtle bug in "Apply Line" in depot window Reply #5 – May 01, 2010, 03:31:55 pm Neroden,thank you for working this one out! What is supposed to happen is that the depot window expands as more vehicles are added, instead of when you press the "apply line" button. I have fixed this now in -devel so that this does, indeed, occur. Thank you for the investigations! Quote Selected