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

fix issues when loading randomcycle from disabled folder #1428

Merged
merged 3 commits into from
Mar 14, 2021
Merged

fix issues when loading randomcycle from disabled folder #1428

merged 3 commits into from
Mar 14, 2021

Conversation

sapphonie
Copy link
Contributor

currently, when loading randomcycle, it runs Timer_RandomizeNextmap twice, leading to odd behavior where the map gets changed twice after timelimit is reached. This fixes that issue by only allowing the timer to be run once per map.

@peace-maker
Copy link
Member

So OnConfigsExecuted is executed multiple times when a plugin is loaded late?

@KyleSanderson
Copy link
Member

So OnConfigsExecuted is executed multiple times when a plugin is loaded late?

If the map changes twice from our data model there can be multiples of these timers running because this isn't killed with fire when the level ends. To fix this one I think we just need TIMER_FLAG_NOMAPCHANGE and nuke the global as it isn't needed and welcomes glitches.

There was an ancient issue with OnConfigsExecuted firing multiple times, and that could indeed be the issue here (if you want to step through with a debugger that would be cool). However, I'd suspect there's multiple map plugins loaded at the moment, so the server is changing levels twice (which also happened to me, over 10 years ago).

I do believe the current PR resolves the issue, but I don't believe it's the correct fix.

@peace-maker peace-maker added the Bug general bugs; can be anything label Mar 12, 2021
Copy link
Member

@peace-maker peace-maker left a comment

Choose a reason for hiding this comment

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

Thank you for bringing this up! Please consider the following change if you have the time!

plugins/randomcycle.sp Show resolved Hide resolved
Copy link
Member

@KyleSanderson KyleSanderson left a comment

Choose a reason for hiding this comment

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

The flag is in the wrong arg.

plugins/randomcycle.sp Outdated Show resolved Hide resolved
@Headline Headline merged commit 4dd5ab7 into alliedmodders:master Mar 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug general bugs; can be anything
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants