Fixed electrification propagation on switches
*Fixed NON_ELECTRIFIED status being propagated back when NEVP is on a track with more than 2 connections
coming from >------------[-- NEVP --]----> propagate
/
don't propagate! <----/ ^ current track with 3 connections
This commit is contained in:
parent
bb5de115b7
commit
72c3c7f089
@ -112,8 +112,20 @@ export default class ElectrificationResolver {
|
||||
return;
|
||||
}
|
||||
|
||||
// only propagate NON_ELECTRIFIED status forward when NEVP is on a track with more than 2 connections
|
||||
let additionalSkipIds = [];
|
||||
if(track.hasNEVP && track.connections.length > 2) {
|
||||
const comingFromConnection = track.connections.find(connection => connection.otherTrackId === skipTrackId) || null;
|
||||
const comingFromEnd = comingFromConnection?.end || null;
|
||||
|
||||
additionalSkipIds = track.connections
|
||||
.filter(connection => connection.end === comingFromEnd)
|
||||
.map(connection => connection.otherTrackId);
|
||||
}
|
||||
|
||||
track.connections.forEach(connection => {
|
||||
if (skipTrackId === connection.otherTrackId) return;
|
||||
if (additionalSkipIds.includes(connection.otherTrackId)) return;
|
||||
this._propagate(connection.otherTrack, track.id, track.electrificationStatus);
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user