Skip to content

Commit 0b2946b

Browse files
Return Amount for Dynamic Troops if the given Village has no Data
1 parent 68dd629 commit 0b2946b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Core/src/main/java/de/tor/tribes/io/TroopAmountElement.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,15 @@ public int getTroopsAmount(Village pVillage) {
133133
} else if (pVillage == null) {
134134
//no village given with fixed amount, just return the Amount
135135
return wanted;
136+
} else if (availableAmounts == null) {
137+
//no troops read just insert what we got
138+
return wanted;
136139
} else {
137140
//return max. avail count
138141
return availableAmount;
139142
}
140143
}
141-
throw new RuntimeException("The code must not come to this Point");
144+
throw new RuntimeException("The code must not come to this Point " + val.getClass().getCanonicalName() + " / " + val);
142145
}
143146

144147
@Override

0 commit comments

Comments
 (0)