FS#218 - Immediate unload of transferred cargo when waiting for full load

Attached to Project: OpenTTD
Opened by TubularBell (TubularBell) - Saturday, 24 June 2006, 12:03 GMT
Type Patch
Category Core
Status Closed
Assigned To No-one
Operating System All
Severity Low
Priority Normal
Reported Version 0.4.7
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


Note: See attached savefile for graphical explanation of the problem. Un-stop the bus and unpause. Enjoy the show.

There is a problem using the Transfer system. When a feeder-line unload+tranfers its cargo on a station that has the main line waiting for full load, the main line picks up the cargo (which sets it's cargo_source to the station the feeder came from!). The next tick the game sees this cargo in the main line, checks the cargo_source and realizes it does not match the current station and therefor unloads. Result: immediate unload of transferred cargo.

My patch adds a check to the unload routine to check if the current order is Full Load. If it is, the unload will not happen - why would you want a vehicle that's loading up to be unloaded?

Note: This is my first time writing C++ for the public and my first time messing in OpenTTD. If I made mistakes, I'd be happy to hear them.
This task depends upon

Closed by  Darkvater (Darkvater)
Thursday, 02 November 2006, 15:50 GMT
Reason for closing:  Duplicate
Additional comments about closing:  251, please continue there
Comment by TubularBell (TubularBell) - Saturday, 24 June 2006, 12:09 GMT
Doh. You can shoot me now. The patch does fix the problem beautifully. However, it also stops vehicles from unloading at all. That's what I get for doing something I know nothing about. Back the sketchboard.
Comment by PandaMojo (PandaMojo) - Sunday, 20 August 2006, 03:46 GMT
Seems to be a fix/duplicate of  FS#177 . Added a patch which seems to work there. Took me the better part of half a day to figure out, and thought I'd solved it 3 times without other sideffects at least. Hopefully the current one truely is :-).