diff --git a/game/scripts/cds.rpy b/game/scripts/cds.rpy index 76c09dc4..1a3ab850 100644 --- a/game/scripts/cds.rpy +++ b/game/scripts/cds.rpy @@ -149,8 +149,9 @@ python early hide: for block, weight in blocks: if n <= weight: - break - else: - n -= weight + return block + n -= weight - return block + # In the rare event where weights are incorrectly assigned, + # return a random available block, and in any other case None. + return renpy.random.choice(blocks)[0] if blocks else None