added action StopAllTrains, added null checks

This commit is contained in:
Stephan Richter
2020-11-08 22:36:12 +01:00
parent b899572f55
commit 2b03c08fa1
9 changed files with 30 additions and 14 deletions

View File

@@ -90,8 +90,8 @@ public abstract class Block extends StretchableTile{
@Override
public Tile update(HashMap<String, String> params) throws IOException {
if (params.containsKey(NAME)) name=params.get(NAME);
if (params.containsKey(Train.HEAD)) {
int trainId = Integer.parseInt(params.get(Train.HEAD));
if (params.containsKey(Train.class.getSimpleName())) {
int trainId = Integer.parseInt(params.get(Train.class.getSimpleName()));
if (trainId == 0) {
if (isSet(train)) train.dropTrace();
train = null;