mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-18 06:49:18 +02:00
Do not start a shut down engine on a signal; address SonarCloud findings
A permitting signal no longer wakes a dormant AI: the synthetic departure command, the shunt-signal ownership tag and the secondary scan that fed them are gone, and cm_SetVelocity / cm_ShuntVelocity go back to plain PutCommand with the pre-existing order mask. A secondary now only settles its own vehicle. Claiming the lead stays for explicit orders. The rest is SonarCloud cleanup on the branch: if-init statements, merged and flattened conditionals, split chained assignments, ranges::any_of, pointer-to-const parameters, std::array for the flag name table and no more shadowed names.
This commit is contained in:
@@ -852,8 +852,8 @@ TDynamicObject *select_trainset_driver( trainset_data &trainset )
|
||||
if( vehicle->Mechanik == nullptr || !vehicle->Mechanik->primary() ) {
|
||||
continue;
|
||||
}
|
||||
auto const lookup { trainset.assignment.find( Global.asLang ) };
|
||||
if( lookup != trainset.assignment.end() ) {
|
||||
if( auto const lookup { trainset.assignment.find( Global.asLang ) };
|
||||
lookup != trainset.assignment.end() ) {
|
||||
vehicle->Mechanik->assignment() = lookup->second;
|
||||
}
|
||||
return vehicle;
|
||||
|
||||
Reference in New Issue
Block a user