Allow random CDS to return None, and fix weights.

This commit is contained in:
LoafyLemon 2024-08-09 15:49:21 +01:00
parent 9a50a836db
commit dc348a729a

View File

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