OpenTTD

Tasklist

FS#6514 - Missing documentation for AIVehicle::RefitVehicle

Attached to Project: OpenTTD
Opened by Kogut (Kogut) - Wednesday, 21 September 2016, 11:50 GMT
Type Bug
Category Script → NoAI
Status New
Assigned To No-one
Operating System All
Severity Low
Priority Normal
Reported Version 1.6.1
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

Details

Wagon unattached to engine may not be refitted, even if other preconditions are fullfilled.

Note that wagon in depot, unattached to an engine will not always return false for IsValidVehicle(vehicle_id) (note also AIVehicle.MoveWagon must be able to move newly constructed wagon, so it is tricky whatever lone wagon should return true for IsValidVehicle).

It seems that presence of engine changes whatever lone wagon IsValidVehicle but it is changing whatever lone wagon may be refitted.

I attached also debug AI used to test game behaviour.
This task depends upon

2016-09-21: A task closure has been requested.
Comment by Kogut (Kogut) - Wednesday, 21 September 2016, 12:05 GMT
It gets better: I am investigating further, but at least in part it is confused by AIVehicle::BuildVehicle problem.

If depot already has unattached wagons AIVehicle::BuildVehicle will return id, but wagon will join other wagons and therefore this id will immediately become invalid.

Loading...