[TF2] Gamemode prefix check fails when loading map from Workshop #1544
+12
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
tl;dr - some map prefix checks don't account for the
workshop/
prefix, which leads to problems. This PR fixes that.When TF2 maps are loaded directly from the workshop via
map workshop/<entryid>
, the mapname has a different format:While most map prefix checks do account for this, there's a few exceptions that don't, which leads to the following observable bugs:
CTFPlayer::PrecacheMvM();
never gets triggered, therefore some MvM assets never get loaded/cached. Namely, footstep sounds.IsCustomGameMode()
check for VSH and ZI fails, meaningserver_custom.cfg
never gets loaded and theautoteam
command still works (it's meant to be disabled in those gamemodes).Because maps are usually playtested before being uploaded to the workshop, very often these bugs don't get caught by the mappers.