mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-03 12:25:27 +01:00
13e9191427
Folding doors (DoorOpenMethod=Fold) turned at a constant speed. Their speed now changes along the way, in the same time as before (range / OpenSpeed, range / CloseSpeed): - opening is fastest at the closed door, slows down around half way and creeps to a stop at the fully open one; - closing swings to half way and then shuts, each part speeding up from its start and slowing down to its end. The new optional key DoorFoldHold=<s> in the Doors: line of the .fiz holds a closing door at half way for that many seconds, with the wings rocking a little towards the closed door, a bit differently each time. Without it there is no hold, and the random numbers are drawn only for a hold, so vehicles without the key keep theirs. The position of a folding door now follows its wings, so such a door counts as open or closed only when its wings are; with a hold, the AI departs after it. Other kinds of doors move as before. The motion is in vehicle/doorwings.h (fold_times_of, fold_begin, fold_advance) with unit tests; the rocking is applied to the animation only. Game data (SVN pctga), changed in the working copy, to be committed there with this change: the Doors: line of the 45 coach .fiz files with DoorOpenMethod=Fold in dynamic/pkp (11xa_v2, 14xa_v1, 110a_v2, 111arow_v1, 11xa-techniczne_v1, bdhinu_v1) goes from OpenSpeed=70 CloseSpeed=400 to OpenSpeed=32 CloseSpeed=53 and gets DoorFoldHold=3.3 (2.5 s opening, 1.5 s closing and a 3.3 s hold, as in a recording of an IC coach). The road vehicles with folding doors are left as they are, without a hold. Either part works without the other: this code on the old data opens and closes in the old times without a hold; the new data on an older build only makes the doors slower, the older build ignoring DoorFoldHold.