Actually remove crashed trains

This commit is contained in:
Arne Keller 2020-02-18 14:40:21 +01:00
parent 302b755ee6
commit fa62ba267f

View File

@ -479,6 +479,7 @@ public class ModelRailwaySimulation {
|| occupiedByOtherTrainPreviously.stream().anyMatch(occupiedByThisTrain::contains); || occupiedByOtherTrainPreviously.stream().anyMatch(occupiedByThisTrain::contains);
if (anyIntersection) { if (anyIntersection) {
train.removeFromRails(); train.removeFromRails();
otherTrain.removeFromRails();
// try to find/merge existing collisions // try to find/merge existing collisions
Set<Train> existingCollision = null; Set<Train> existingCollision = null;
for (Set<Train> collision : collisions) { for (Set<Train> collision : collisions) {