Dice Roll Fix

If you liked this item, please rate it up on Steam Workshop page.

Author: uGuardian

Last revision: 20 Apr, 2022 at 21:38 UTC

File size: 978.94 KB

On Steam Workshop

Description:

Patches the awful vanilla dice roll implementation to be magnitudes more efficient.
Only has a notable performance impact on dice rolls with extremely large ranges or clashes with an extremely large number of dice.
Also prevents softlocks due to absurdly wide-ranged rolls.

A roll with a maximum value of exactly 2147483647 will overflow, but you probably shouldn’t be using a value that large. Also vanilla rolls will break if the result is one higher than that anyways.

MakeDiceResult’s tuneLevel still does nothing with this patch, although it already does nothing in vanilla. If tuneLevel does not equal 0, this patch will defer to vanilla logic just in case something else patches tuneLevel back in.

Thanks to Invidia for making the thumbnail.