You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AI: wagons are lost in depot because of lack of API feature #5685
There's simply no feature to get a vehicle that isn't made of a train engine.
Every tricks i tried fail :
- AIVehicleList_Depot : list only vehicle with orders for the depot, and of course wagons have no orders
- AIVehicleList_DefaultGroup : they aren't in the list
- AIVehicleList : they aren't in the list
...
Out of all functions i tried, none answer a valid vehicle ID and just all list as just empty.
You can handle that in the game by taking great care this never happen (that you loose the vehicle ID of the newly create wagon), else you're dead.
But there a race condition you cannot avoid : create wagon if user save before you attach it to an engine or before you sell it : you're dead, on next loading you don't have the vehicleID and it's now impossible to get it.
Results :
- wagons stays in the depot and you don't know it
- there's no way you could remove the depot, as wagons are in it.
- depot cannot be switch to another rail type depot.
- And of course, plenty weirdness as the AI is getting mad trying to figure out what's going on there :)
Activity
TrueBrain commentedon Apr 14, 2018
How evil! I guess a function to list unconnected wagons or something is not the worst idea :D
fanioz commentedon Jun 15, 2018
I found on script_vehicle.cpp, a free wagon is valid vehicle :
Can we implement that in "ScriptVehicleList" , so that AI/GS VehicleList will include those free wagon ID?
Fix OpenTTD#5685:AI: wagons lost in depot because of lack of API feat…
Fix OpenTTD#5685:AI: wagons lost in depot because of lack of API feat…
Fix OpenTTD#5685: Check for free wagons in ScriptVehicleList
Fix OpenTTD#5685: Check for free wagons in ScriptVehicleList
Fix OpenTTD#5685: Check for free wagons in ScriptVehicleList
Fix OpenTTD#5685: Check for free wagons in ScriptVehicleList
Fix OpenTTD#5685: Check for free wagons in ScriptVehicleList (OpenTTD…
Fix #5685: Check for free wagons in ScriptVehicleList (#7617)
Fix OpenTTD#5685: Check for free wagons in ScriptVehicleList