Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔨 Lua: math.random() calls should always be bounded #6407

Open
3 tasks done
zach2good opened this issue Nov 4, 2024 · 0 comments
Open
3 tasks done

🔨 Lua: math.random() calls should always be bounded #6407

zach2good opened this issue Nov 4, 2024 · 0 comments
Labels
enhancement New feature request good first issue Good for newcomers

Comments

@zach2good
Copy link
Contributor

I affirm:

  • I understand that if I do not agree to the following points by completing the checkboxes my issue will be ignored.
  • I have read and understood the Contributing Guide and the Code of Conduct.
  • I have searched existing issues to see if the issue has already been opened, and I have checked the commit log to see if the issue has been resolved since my server was last updated.

Describe the feature

Looking at this PR: #6406

I see we have 100 results for math.random() with no arguments, which returns a float between 0-1, which we typically are multiplying by 100 and then flooring.

We have 4 results for the regex: random\(\d\).

I think we should be using math.random(1, 100) in pretty much every case, unless we're picking from a container, matching onto stats, etc.

@zach2good zach2good added enhancement New feature request good first issue Good for newcomers labels Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant