Use drop chance correctly
Given that `randf` output is in the range [0, 1] inclusive, and we want `chance = 0` to mean never, and `chance = 1` to mean always, we need to worry about the edge cases. We need the `>=` because when `randf() == 0` and `chance == 0` just using `>` would give us the wrong result. We need to compare against 1 because when `randf() == 1` and `chance == 1` we would get the wrong reasult due to the `>=`. This is the from I found easier to read.
Loading
Please register or sign in to comment