The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: paichtis on December 12, 2012, 03:50:16 PM

Title: Joining a public station
Post by: paichtis on December 12, 2012, 03:50:16 PM
Perhaps this a known bug...

If one adds a terminal to a public station all passengers waiting to go there are discarded.  (I noticed it with PAX - on  b.64. server -  but most probably happens with other goods too.)
Title: Re: Joining a public station
Post by: prissi on December 12, 2012, 06:01:49 PM
This is due to passengers routed by destinations, and the internal handle of the halt changed. However, it may be very much possible to see if a different halt exists for the stations/convoi those are loaded to.
Title: Re: Joining a public station
Post by: Fabio on December 12, 2012, 06:15:15 PM
But when merging, couldn't be possible just to look up the handler of the removed station and replace it with the new handle?
Title: Re: Joining a public station
Post by: prissi on December 12, 2012, 07:29:15 PM
The purpose of of handles is to expire when the target station does no longer exist. It only affects people in convois that change at the next stop, the people in stations are properly rerouted.


EDIT: However the freight deletion routine was only called on odd occasions. Now freight which can be delivered will be kept.
Title: Re: Joining a public station
Post by: Dwachs on December 13, 2012, 10:39:17 AM
Imho, it would make more sense to mark convoys to 'remove stale freight', then unload such a marked convoy completely at the next halt (which triggers route search for all the cargo in haltestelle_t::liefere_an), and load again. Then no cargo gets lost that still could reach its target. Undeliverable cargo is discarded by haltestelle_t::liefere_an.  (Currently remove_stale_freigth removes all cargo on a convoy that could not reach their target with the current convoy).

What do you think? (Ofc this can wait until after next releaseTM)
Title: Re: Joining a public station
Post by: prissi on December 13, 2012, 01:05:27 PM
Marking stale seems indeed the best way. This should be added as it would cure the problem in the german game. On the server I could easily generate eternally fully loaded convois by just deleting a stop on one location and then building something new there.

I would try to release without known and easily fixable bugs.

EDIT: current routine had still errors. r6181 should work as intended.
Title: Re: Joining a public station
Post by: Dwachs on December 14, 2012, 08:41:29 PM
Imho, there are still some border cases not covered. Patch attached. Changes:

-- make sure that always ware.ziel is bound, otherwise vehikel_t::unload_freight will drop the cargo silently
-- the check whether a halt on the schedule is a target of the cargo is dropped there, as it is the very first thing that is checked in haltestelle_t::liefere_an

Could you test please if it does not break anything else?
Title: Re: Joining a public station
Post by: prissi on December 14, 2012, 09:26:40 PM
Thank you for spotting the thing with the bound ziel halt. But that could only occur, if there was still at least one trasnfer needed and thus the convoi was not in the stale list for this halt. Very well done.

Looks fine to me, just commit it please. It is sure better than what we have now.
Title: Re: Joining a public station
Post by: Dwachs on December 15, 2012, 09:09:59 AM
Done with r6189.