Fix treasure pool levels
This commit is contained in:
parent
81492f2985
commit
88e82ad9c8
@ -56,17 +56,11 @@ class TreasurePoolDefinition(pieces: List<Piece>) {
|
||||
visitedPools.put(name, new)
|
||||
|
||||
try {
|
||||
for (piece in pieces) {
|
||||
if (level <= piece.startingLevel) {
|
||||
return piece.evaluate(random, level, visitedPools)
|
||||
}
|
||||
if (pieces.isNotEmpty()) {
|
||||
return pieces.last { it.startingLevel <= level }.evaluate(random, level, visitedPools)
|
||||
}
|
||||
|
||||
if (pieces.last().startingLevel <= level) {
|
||||
return pieces.last().evaluate(random, level, visitedPools)
|
||||
} else {
|
||||
return emptyList()
|
||||
}
|
||||
return emptyList()
|
||||
} finally {
|
||||
visitedPools.put(name, visitedPools.getInt(name) - 1)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user