Fix random function in testing trying to run trials when rng tag is 0/RNG_NONE (#8460)

This commit is contained in:
Martin Griffin 2025-12-07 16:38:37 +00:00 committed by GitHub
commit 22dcef88c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -650,7 +650,7 @@ static u32 BattleTest_RandomUniform(enum RandomTag tag, u32 lo, u32 hi, bool32 (
}
}
//trials
if (tag == STATE->rngTag)
if (tag && tag == STATE->rngTag)
return RandomUniformTrials(tag, lo, hi, reject, caller);
//default
@ -670,7 +670,7 @@ static u32 BattleTest_RandomWeightedArray(enum RandomTag tag, u32 sum, u32 n, co
}
//trials
if (tag == STATE->rngTag)
if (tag && tag == STATE->rngTag)
return RandomWeightedArrayTrials(tag, sum, n, weights, caller);
//default
@ -725,7 +725,7 @@ static const void *BattleTest_RandomElementArray(enum RandomTag tag, const void
//trials
if (tag == STATE->rngTag)
if (tag && tag == STATE->rngTag)
return RandomElementArrayTrials(tag, array, size, count, caller);
//default