Skip to content
Commit c87a8246 authored by Theraot's avatar Theraot
Browse files

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.
parent 2829f56c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment