It seems that the game doesn’t follow the low/high conditions as it should. It potentially could cause problems with random numbers being out of range or stuff. I’m not sure how the algorithm works, currently, though it does seem to translate [tt]rand()[/tt] to the correct range then adding [tt]low[/tt] to the result. Adding
[tt]if (low > high)
{ long temp = high;
high = low;
low = temp;
}[/tt]
presumably fixes the issue.
Stumbled upon this while trying to figure out how to mod Cataclysm. o_O I’m not sure if it’s a bug or a feature. I wouldn’t even have known if not for boost.random’s assert, as I tried to use the uniform_int_distribution boost has instead of a rand()-using formula.
Huh. I know that one high-level encounter doesn’t always spawn its participants like it seems it should. Though there’s certainly other possible reasons for that (probably including my misreading its code) this is certainly interesting.