- empty() instead of size() comparisons (cpp:S1155)
- member initialisers in declaration order (cpp:S3229)
- no redundant c_str() when a std::string is accepted (cpp:S7121)
- contains() on associative containers (cpp:S6171)
- const reference instead of a copying range-for (cpp:S6032)
- starts_with() for prefix checks (cpp:S6178)
- no std::move on temporaries (cpp:S5274)
- has_value() on std::optional (cpp:S7172)
- bool literals for bool members (cpp:S5820)
- inline only on the definition (cpp:S3548)
- explicit base access specifier (cpp:S5965)
- explicit element access instead of dereferencing an array (cpp:S7116)
- rely on the C++20 rewritten operator!= (cpp:S6186)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
'DamageFlag & dtrain_bearing > 0' parsed as 'DamageFlag & (dtrain_bearing > 0)',
i.e. DamageFlag & 1, so bearing friction reacted to the wrong damage flag.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
std::unordered_map instances and map types exposed in headers used by
other modules are left as they are.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signatures declared in files touched by PR 206 (Driver.h, EU07.cpp) and
virtual overrides are left unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Applied only where no unqualified name in the block could be captured by
the introduced enumerators.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Only local variables and definition parameters are renamed; shadowing
struct fields and enumerators in headers are left for a separate change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Unused names are commented out; parameters used only on some platforms
are marked [[maybe_unused]].
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CabActivisation() passed DirAbsolute (DirActive * CabActive) as the value of the
"Direction" command, which every receiving vehicle stores as its own DirActive.
Every other sender passes DirActive. With the cab at the rear end (CabActive = -1)
the two have opposite signs, so the other units got their reverser flipped
against the controlling one.
It shows whenever a rear cab is activated after the reverser has been set:
- the AI takes over an occupied cab (TakeControl() calls CabActivisation(true)),
e.g. an EN57 inserted with reardriver and a starting velocity: the motor car
drives the train backwards;
- a vehicle without automatic cab activation (SA134) driven by the AI from the
start: the cab is activated by a driver hint after the reverser is set, and
the two units pull against each other.
Fixes#169.
When the Autorewident function is enabled, the EP fuse switch will no longer automatically engage or disengage if the player is controlling the train. This would happen for example when approaching a station.