From: Stefan F. <ste...@us...> - 2011-09-20 10:11:24
|
rails/algorithms/NetworkVertex.java | 5 +++-- rails/game/Stop.java | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) New commits: commit 6f0ec2417866c9861df2845add71c584b952d421 Author: Stefan Frey <ste...@we...> Date: Tue Sep 20 12:13:06 2011 +0200 Fixed missing check for no-tokens stop in runthrough allowed method diff --git a/rails/algorithms/NetworkVertex.java b/rails/algorithms/NetworkVertex.java index cbe5394..91356af 100644 --- a/rails/algorithms/NetworkVertex.java +++ b/rails/algorithms/NetworkVertex.java @@ -227,8 +227,9 @@ public final class NetworkVertex implements Comparable<NetworkVertex> { // check if it has to be removed because it is run-to only // if company == null, then no vertex gets removed - if (company != null && !city.isRunToAllowedFor(company)) { - return false; + if (company != null && !city.isRunToAllowedFor(company)) { + log.info("Vertex is removed"); + return false; } // check if it is a major or minor diff --git a/rails/game/Stop.java b/rails/game/Stop.java index 7bf116a..d1e918c 100644 --- a/rails/game/Stop.java +++ b/rails/game/Stop.java @@ -344,8 +344,8 @@ public class Stop implements TokenHolder { public boolean isRunThroughAllowedFor (PublicCompanyI company) { switch (runThroughAllowed) { - case YES: - return hasTokenOf (company) || hasTokenSlotsLeft(); + case YES: // either it has no tokens at all, or it has a company tokens or empty token slots + return !hasTokens() || hasTokenOf (company) || hasTokenSlotsLeft() ; case NO: return false; case TOKENONLY: |