[Core] Fix `rand_weighted` not using the current state

The method incorrectly used `Math::randf` instead of `randf`
This commit is contained in:
A Thousand Ships 2024-03-17 19:21:16 +01:00
parent fe01776f05
commit 9c518d5f42
No known key found for this signature in database
GPG Key ID: 2033189A662F8BD7
1 changed files with 1 additions and 1 deletions

View File

@ -52,7 +52,7 @@ int64_t RandomPCG::rand_weighted(const Vector<float> &p_weights) {
weights_sum += weights[i];
}
float remaining_distance = Math::randf() * weights_sum;
float remaining_distance = randf() * weights_sum;
for (int64_t i = 0; i < weights_size; ++i) {
remaining_distance -= weights[i];
if (remaining_distance < 0) {