Fix treasure pool levels

This commit is contained in:
DBotThePony 2024-04-21 23:37:51 +07:00
parent 81492f2985
commit 88e82ad9c8
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -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)
}