Weighted entity picks are now seeded

This commit is contained in:
Marcin Kostrzewski 2020-05-16 22:50:56 +02:00
parent 8c2a3f2bff
commit 6725c4ae0c

View File

@ -171,4 +171,7 @@ def pickEntity(player, map):
if not finalEntities:
# If all items are gone, pick random one
finalEntities = map.getInteractablesByClassifier()
return random.choices(finalEntities, finalWeights)[0]
random.seed(10)
choice = random.choices(finalEntities, finalWeights)[0]
random.seed()
return choice