diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-03-04 13:34:18 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-03-04 13:34:18 +0100 |
commit | 48aa12011b9338cd73a4243c625bbb400f1bfe38 (patch) | |
tree | 38754744ca3b1db40496a52dd4ecd5541460cfe6 /core/math/random_pcg.cpp | |
parent | de59a9547c07cfbbc80acbec072ff5ab0ccf4c90 (diff) | |
parent | 981883d041f6e316cb88c4411e9b140192a9da5e (diff) | |
download | redot-engine-48aa12011b9338cd73a4243c625bbb400f1bfe38.tar.gz |
Merge pull request #89104 from luevano/fix-rand-weighted
Fix `RandomNumberGenerator::rand_weighted` return type
Diffstat (limited to 'core/math/random_pcg.cpp')
-rw-r--r-- | core/math/random_pcg.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/math/random_pcg.cpp b/core/math/random_pcg.cpp index e754a34271..e083820494 100644 --- a/core/math/random_pcg.cpp +++ b/core/math/random_pcg.cpp @@ -43,7 +43,7 @@ void RandomPCG::randomize() { seed(((uint64_t)OS::get_singleton()->get_unix_time() + OS::get_singleton()->get_ticks_usec()) * pcg.state + PCG_DEFAULT_INC_64); } -int RandomPCG::rand_weighted(const Vector<float> &p_weights) { +int64_t RandomPCG::rand_weighted(const Vector<float> &p_weights) { ERR_FAIL_COND_V_MSG(p_weights.is_empty(), -1, "Weights array is empty."); int64_t weights_size = p_weights.size(); const float *weights = p_weights.ptr(); |