SexScripts : Wheel Of Discipline - https://ss.deviatenow.com:443/viewtopic.php?f=7&t=514 Page 2 of 2

Wheel Of Discipline bug

ralph333 [ Sat May 05, 2018 11:45 pm ]

There is a bug in setWheelTotalSpins when wheelTotalSpinsRandom is true. You are more likely to get wheelTotalSpinsMin then any other value (unless min is 1). The chance of that happening goes up with larger values of wheelTotalSpinsMin.

Using the default min/max values of 2 & 6, you should get one of 2 3 4 5 6 depending on the random() result. But as is, you get one of : 2 2 3 4 5 6. If the min/max are 4 & 6, you get: 4 4 4 4 5 6

To fix, replace

wheelTotalSpins = getRandom(wheelTotalSpinsMax)+1 // gives 1..max
if(wheelTotalSpins<wheelTotalSpinsMin)
wheelTotalSpins = wheelTotalSpinsMin // maps all values < min to min

with

wheelTotalSpins = getRandom(wheelTotalSpinsMax - wheelTotalSpinsMin + 1) + wheelTotalSpinsMin

Re: Wheel Of Discipline bug

Banjo [ Sun May 06, 2018 9:02 am ]

ralph333 wrote:
There is a bug in setWheelTotalSpins when wheelTotalSpinsRandom is true. You are more likely to get wheelTotalSpinsMin then any other value (unless min is 1). The chance of that happening goes up with larger values of wheelTotalSpinsMin.

Using the default min/max values of 2 & 6, you should get one of 2 3 4 5 6 depending on the random() result. But as is, you get one of : 2 2 3 4 5 6. If the min/max are 4 & 6, you get: 4 4 4 4 5 6

To fix, replace

wheelTotalSpins = getRandom(wheelTotalSpinsMax)+1 // gives 1..max
if(wheelTotalSpins<wheelTotalSpinsMin)
wheelTotalSpins = wheelTotalSpinsMin // maps all values < min to min

with

wheelTotalSpins = getRandom(wheelTotalSpinsMax - wheelTotalSpinsMin + 1) + wheelTotalSpinsMin

Thanks for spotting that and highlighting the fix. I will update tomorrow with this fixed! :)

Page 2 of 2 All times are UTC + 1 hour [ DST ]
https://ss.deviatenow.com:443/
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Maroon Fusion theme created by Oxydo
Software, theme modifications, phpBB modification by Doti 2010, 2011