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
When an AI is at the max num of vehicles, AIVehicle.GetBuildWithRefitCapacity returns the actual capacity
Actual result
When an AI is at the max num of vehicles, AIVehicle.GetBuildWithRefitCapacity returns -1
Steps to reproduce
My AI builds aircraft and reaches the limit. It still continues its aircraft management checking if there are newer engine models available from time to time. I noticed a weird behaviour when Bakewell Luckett LB-9 became available. Normally, the AI would start replacing the old model of choice, the Coleman Count to this new model.
It failed to do so because it was simulating the new income using a capacity of -1 for passengers when using AIVehicle.GetBuildWithRefitCapacity function.
After investigating openttd code, I found that the issue is due to GetFreeUnitNumber not allowing a new vehicle to be temporarily purchased for requesting the refited capacity amount.
Version of OpenTTD
20210620-master-g6a05839d8d
Expected result
When an AI is at the max num of vehicles, AIVehicle.GetBuildWithRefitCapacity returns the actual capacity
Actual result
When an AI is at the max num of vehicles, AIVehicle.GetBuildWithRefitCapacity returns -1
Steps to reproduce
My AI builds aircraft and reaches the limit. It still continues its aircraft management checking if there are newer engine models available from time to time. I noticed a weird behaviour when Bakewell Luckett LB-9 became available. Normally, the AI would start replacing the old model of choice, the Coleman Count to this new model.
It failed to do so because it was simulating the new income using a capacity of -1 for passengers when using AIVehicle.GetBuildWithRefitCapacity function.
After investigating openttd code, I found that the issue is due to GetFreeUnitNumber not allowing a new vehicle to be temporarily purchased for requesting the refited capacity amount.
OpenTTD/src/vehicle_cmd.cpp
Line 127 in 6a05839
The text was updated successfully, but these errors were encountered: