AI train speed variable not initialized
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Open Rails |
Fix Released
|
Medium
|
Carlo Santucci |
Bug Description
LastSpeedMpS contains the preceding speed for AI trains. After a resume with running AI train, or at startup in case the AI train is due to start with speed > 0, LastSpeedMpS is not initialized. As the new speed is computed starting from the preceding speed, AI trains often start at speed zero even if they shouldn't.
LastSpeedMpS has another problem: there are indeed two distinct LastSpeedMpS variables defined, one within AITrain.cs and the other one within Train.cs. The problem is that AI trains use also methods from Train.cs, so they sometimes refer to the variable within AITrain.cs and sometimes to the variable within Train.cs, which I think is misleading.
A first analysis shows that unifying the two variables leads to malfunctions, so I wonder whether LastSpeedMpS within AITrain.cs should be renamed AILastSpeedMpS.
Changed in or: | |
milestone: | none → 1.4 |
Changed in or: | |
status: | Fix Committed → Fix Released |
Fixed in x1.3.1-277