IncredibleHannes / TPF2-Timetables

The Timetable mod for Transport Fever 2
GNU General Public License v3.0
32 stars 19 forks source link

fix bug in constraint time difference computation and simplify #29

Closed wato471 closed 3 years ago

wato471 commented 3 years ago

the previous implementation had a bug where diffSec was always added to the difference when sometimes it would have to be subtracted. for example assume a time of 0:59 and a constraint at 1:00. the previous implementation would calculate a diff of 61 sec when the expected result is 1 sec. therefore I propose this refactoring based on representing both values as seconds which also fixes the aforementioned bug.