From e95ddfaf94208d199a095a7f2c091778a41f88f9 Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Sun, 6 Aug 2017 03:09:47 -0500 Subject: [PATCH] Rewrites incorrect documentation for the pickweight() proc --- code/__HELPERS/_lists.dm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/__HELPERS/_lists.dm b/code/__HELPERS/_lists.dm index df3daeeff9..74322c53af 100644 --- a/code/__HELPERS/_lists.dm +++ b/code/__HELPERS/_lists.dm @@ -177,7 +177,11 @@ result = first ^ second return result -//Pretends to pick an element based on its weight but really just seems to pick a random element. +//Picks a random element from a list based on a weighting system: +//1. Adds up the total of weights for each element +//2. Gets a number between 1 and that total +//3. For each element in the list, subtracts its weighting from that number +//4. If that makes the number 0 or less, return that element. /proc/pickweight(list/L) var/total = 0 var/item