FS#685 - Inconsistent shared orders and assertion failure

Attached to Project: OpenTTD
Opened by jools (jools) - Saturday, 17 March 2007, 15:19 GMT
Last edited by Celestar (Celestar) - Sunday, 18 March 2007, 11:06 GMT
Type Bug
Category Vehicles
Status Closed
Assigned To No-one
Operating System Linux
Severity High
Priority Normal
Reported Version 0.5.0
Due in Version 0.5.1
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


The attachment is a game including two town stations with two passenger trains going between them, on shared orders. Adding a third station to the orders of one of these trains causes an assertion failure.

To reproduce: Get the train list for Larnbridge - two passenger trains 20 and 21. Get the orders for 21, and try to add Meningville to them. This aborts the program with:

CmdInsertOrder: Assertion `v->orders == u->orders' failed

Note that 21's shared-orders train-list button actually brings up a list of two other trains (30 and 31; livestock) under a distinct set of shared orders, which are definitely not the same as 21's. And 30/31's shared-orders train-list buttons bring up a different train list of themselves. Also, train 20 claims to not be on shared orders, but adding Meningville to it adds to 21's too.
This task depends upon

Closed by  Remko Bijker (Rubidium)
Sunday, 18 March 2007, 15:33 GMT
Reason for closing:  Fixed
Additional comments about closing:  In r9277; will be backported to 0.5.1. Sadly enough your savegame won't be fixed. The only thing you can do is remove the trains that have been affected.
Comment by Remko Bijker (Rubidium) - Sunday, 18 March 2007, 10:40 GMT
Did you start this game as a new game in 0.5.0 or did you start it in another version, if so which version did you start this game with?
Comment by Celestar (Celestar) - Sunday, 18 March 2007, 10:45 GMT
Do you happen to have a previous savegame where the orders are not messed up?
Comment by jools (jools) - Sunday, 18 March 2007, 10:50 GMT
This was a completely new game on 0.5.0.
Comment by jools (jools) - Sunday, 18 March 2007, 11:13 GMT
Damn - a previous savegame - such an obvious thing to look for. Looks like I've wiped them out already. :-(

Here's some speculation. I upgraded the passenger trains' engines by creating the new engine, inserting it into the existing train, then deleting the old engine. The new engine temporarily existed as a train by itself - could the orders have got messed up then? I normally upgrade the other way round. Then again, I haven't really used shared orders much.