This commit is contained in:
Stephan Richter
2020-11-05 18:56:51 +01:00
parent 0ef617aa34
commit 86f685219c
4 changed files with 16 additions and 6 deletions

View File

@@ -102,12 +102,13 @@ public abstract class Block extends StretchableTile{
if (params.containsKey(Train.HEAD)) {
int trainId = Integer.parseInt(params.get(Train.HEAD));
if (trainId == 0) {
if (isSet(train)) train.dropTrace();
train = null;
} else {
Train dummy = Train.get(trainId);
if (isSet(dummy) && dummy != train) {
dummy.set(this);
dummy.dropTrace();
Train newTrain = Train.get(trainId);
if (isSet(newTrain) && newTrain != train) {
newTrain.set(this);
newTrain.dropTrace();
}
}
}