Skip to content

Seed rand only once#1422

Merged
Headline merged 1 commit intoalliedmodders:masterfrom
Deathreus:srand
Mar 7, 2021
Merged

Seed rand only once#1422
Headline merged 1 commit intoalliedmodders:masterfrom
Deathreus:srand

Conversation

@Deathreus
Copy link
Contributor

Light testing applied

@Deathreus
Copy link
Contributor Author

See this for why it is needed

Copy link
Member

@Headline Headline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quite surprised this wasn't discovered earlier - thanks for the patch!

@Headline Headline merged commit f9633a5 into alliedmodders:master Mar 7, 2021
@peace-maker
Copy link
Member

I'm not sure that srand call in core is affecting rand calls in logic? Might work that way though.

@asherkin
Copy link
Member

asherkin commented Mar 7, 2021

I'm not sure that srand call in core is affecting rand calls in logic? Might work that way though.

The random seed is thread-local state, so it's shared across all modules in a process.

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.

4 participants