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

Load maps configs always with lowercase #15

Merged
merged 6 commits into from
Jul 26, 2021
Merged

Load maps configs always with lowercase #15

merged 6 commits into from
Jul 26, 2021

Conversation

accelerator74
Copy link
Contributor

Sometimes map configs do not load if the case does not match.
For example, on the l4d2 game server, the campaign "c12" can be loaded either with a capital letter or with a small letter, i.e C12m1_hilltop and sometimes c12m1_hilltop. This applies to the rest of the campaign maps. After changing levels, a capital letter can go lowercase. And it absolutely does not depend on plugins, etc., just for some reason the server loads it like that, although the map bsp file is also written with a small letter. As a result, on a Linux system, you have to create two identical configuration files for one map with the same contents, which is not good. I met such a problem in other games, specifically in cs go.

Copy link

@Alexeyt89 Alexeyt89 left a comment

Choose a reason for hiding this comment

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

As only latin symbols are checked, this
buffer[i] = tolower(str[i]);
can be written like:
buffer[i] = str[i] - ('a' - 'A');
It should work faster as there will be no checks for special characters from other languages.
Also I would rewrite "Stripper Load Config in lowercase" to "Load stripper configs in lowercase"

@accelerator74
Copy link
Contributor Author

Done :)

gameshim/stripper_mm.cpp Outdated Show resolved Hide resolved
@dvander
Copy link
Member

dvander commented Jul 26, 2021

Thanks!

@dvander dvander merged commit 1dbb186 into alliedmodders:master Jul 26, 2021
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.

None yet

3 participants