Uploaded image for project: 'Minecraft (Bedrock codebase)'
  1. Minecraft (Bedrock codebase)
  2. MCPE-129762

Random.h Error, cannot generate a number in range [0,0)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • None
    • 1.16.221 Hotfix
    • None
    • Unconfirmed
    • Windows

      We have seen a issue with random.h showing up in content error logs, one issue seem to be in events key of behavior files, in the subkey "randomize" : [{}].

      The issue is that before (previous version, it was allowed to not include the key "weight" in the children of "randomize" array, I assume it defaulted to value of 1 back then. However, on the newer versions this is no longer the case, it defaults to zero, which causes interesting issues when you sum all of the weights (ALL being zero gives you a sum of 0). so it tries to generate a value in the range [0,0).

      It would be nice with either a direct error message that gives more information of where the ERROR occoured or that default value for weight is set to 1.

       

            Rajkkor Vincent Grenfeldt
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: