AI train speed variable not initialized

Bug #1909684 reported by Carlo Santucci
6
This bug affects 1 person
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.

Tags: ai
Revision history for this message
Carlo Santucci (carlosanit1) wrote :

Fixed in x1.3.1-277

Changed in or:
status: In Progress → Fix Committed
James Ross (twpol)
Changed in or:
milestone: none → 1.4
Changed in or:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.