1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-25 15:37:42 +00:00

Fix RandomNumberGenerator::rand_weighted return type

This commit is contained in:
David Luevano Alvarado
2024-03-02 15:34:51 -06:00
parent f2045ba822
commit 981883d041
4 changed files with 6 additions and 6 deletions

View File

@@ -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();