From fa62ba267fa1362ac1129846fa72fff81ba23851 Mon Sep 17 00:00:00 2001 From: Arne Keller Date: Tue, 18 Feb 2020 14:40:21 +0100 Subject: [PATCH] Actually remove crashed trains --- src/edu/kit/informatik/model/ModelRailwaySimulation.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/edu/kit/informatik/model/ModelRailwaySimulation.java b/src/edu/kit/informatik/model/ModelRailwaySimulation.java index dba0fdb..2a92cee 100644 --- a/src/edu/kit/informatik/model/ModelRailwaySimulation.java +++ b/src/edu/kit/informatik/model/ModelRailwaySimulation.java @@ -479,6 +479,7 @@ public class ModelRailwaySimulation { || occupiedByOtherTrainPreviously.stream().anyMatch(occupiedByThisTrain::contains); if (anyIntersection) { train.removeFromRails(); + otherTrain.removeFromRails(); // try to find/merge existing collisions Set existingCollision = null; for (Set collision : collisions) {