Merge branch 'master' into directional-targets
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -4,7 +4,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>de.srsoftware</groupId>
|
||||
<artifactId>web4rail</artifactId>
|
||||
<version>1.5.31</version>
|
||||
<version>1.5.32</version>
|
||||
<name>Web4Rail</name>
|
||||
<packaging>jar</packaging>
|
||||
<description>Java Model Railway Control</description>
|
||||
|
||||
@@ -25,6 +25,8 @@ public class BlockFree extends Condition {
|
||||
|
||||
@Override
|
||||
public boolean fulfilledBy(Context context) {
|
||||
if (isNull(context)) return false;
|
||||
if (isSet(context.train())) context = context.clone().train(null); // block.isFree would return true, if context.train == block.train. That has to be avoided!
|
||||
if (!inverted) return block.isFreeFor(context);
|
||||
return !block.isFreeFor(new Context(block)); // block.isFreeFor würde true liefern, wenn der Zug im Kontext gleich dem Zug im Block wäre. Da wir aber nur wissen wollen, ob der Block belegt ist, brauchen wir einen Context ohne Zug.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user