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

MapVote: Readded compatibility with old mapvote addons #1592

Merged
merged 2 commits into from
Aug 20, 2024
Merged

Conversation

TimGoll
Copy link
Member

@TimGoll TimGoll commented Aug 20, 2024

Most mapvote addons work by overwriting the LoadNextMap() function. However in a recent rework, the TTT2 gameloop got completely reworked which broke that way of hooking into it.

The easiest solution here is to add a fallback mode that calls the overwritten function if defined. This is done here. Additionally I raise an error to make sure the server owner is aware of the problem.

When this function is called, the next map condition is already met. And since these functions are all based on the old TTT function, the condition will still be met inside it, even if the round counter is decreased by one more. Therefore we don't have to modify any values here.

By doing it that way it is pretty clean and safe to call deprecated map vote trigger functions, without hacking too much into the TTT2 gameloop.

@TimGoll TimGoll added type/bug Something isn't working skip-changelog Skips the requirement for an entry in the CHANGELOG.md labels Aug 20, 2024
@TimGoll TimGoll added this to the v0.14.0b milestone Aug 20, 2024
@TimGoll TimGoll merged commit de03d7e into master Aug 20, 2024
6 checks passed
@TimGoll TimGoll deleted the map-vote-compat branch August 20, 2024 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog Skips the requirement for an entry in the CHANGELOG.md type/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants