Playmaker Forum

Bug Reporting => PlayMaker Bug Reporting => Topic started by: ch1ky3n on July 30, 2018, 10:41:53 AM

Title: Randomize Bug[SOLVED]
Post by: ch1ky3n on July 30, 2018, 10:41:53 AM
Hey All,

I encountered a small problem while updating the PMaker to the latest version. It is the new randomize action that features No Repeat. By default, it is ON/checked. While my state took variables of min and max from my database, there is a case where the min and the max difference is only 1 (Min 3 and Max 4). This will cause a bug and cost Unity to freeze. I wonder if this is a good report for you guys!

Thank You
Title: Re: Randomize Bug
Post by: jeanfabre on July 31, 2018, 04:16:21 AM
Hi,

Yep, thanks for reporting this.

 which action exactly? I'll try to repro and escaladate a bug report.

 feel free to report on this via the PlayMaker bug report, We always welcome your input when you find issues.

Bye,

 Jean
Title: Re: Randomize Bug
Post by: ch1ky3n on August 01, 2018, 04:21:14 PM
I believe it is Randomize int
The “No Repeat” box is checked by default and could cause unity to freeze when the difference between min value and max value is 1
Like
Min 3
Max 4
Title: Re: Randomize Bug
Post by: jeanfabre on August 20, 2018, 03:21:12 AM
Hi,

 good catch, Trying to find the issue at the moment.

 Bye,

 Jean
Title: Re: Randomize Bug
Post by: jeanfabre on August 20, 2018, 03:35:52 AM
Hi,

 Well, the problem is that if your min and max difference is 1 and you haven't checked "inclusive Max", then yes you have an issue if you don't want no repeat in the randomization.

 to fix the action ( while we push an update for the fix to be official)

replace line 52 of RandomInt to:

Code: [Select]
if (noRepeat.Value && max.Value != min.Value && (!inclusiveMax && (Mathf.Abs (max.Value - min.Value) > 1) ))
Bye,

 Jean