Skip to content

Added logic to reset Random.state in ColorSettings to avoid polutting… #404

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

Merged
merged 1 commit into from
Jul 21, 2025

Conversation

lordofduct
Copy link
Contributor

ColorSettings has logic that resets the global rng state with a seed of 0. This results in RNG behaving deterministically the same when in the editor.

Fixed by caching the current state of Random and then setting it back after filling the outlines2D array.

Considering the logic as is will always fill outlines2D array with the same values. If this is the intended behavior then it could be refactored to just have a static definition of what should be in outlines2D.

@Eideren
Copy link
Contributor

Eideren commented Jul 18, 2025

Looks like you mixed up the indentation style, that section uses tabs instead of spaces. Looks like a good change to me otherwise

@lordofduct
Copy link
Contributor Author

My IDE does 4-space tabs which look identical to regular tabs in editor. Seems github's font doesn't equal space 4-space and tabs (possibly for python-like languages?). Didn't notice until pull request submitted.

@LogicalError
Copy link
Owner

Thanks!

@LogicalError LogicalError merged commit e0ea083 into LogicalError:master Jul 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants