Skip to content

Update Command NextMap#396

Open
K-Faktor wants to merge 2 commits intoRaidMax:developfrom
K-Faktor:develop
Open

Update Command NextMap#396
K-Faktor wants to merge 2 commits intoRaidMax:developfrom
K-Faktor:develop

Conversation

@K-Faktor
Copy link

@K-Faktor K-Faktor commented Feb 3, 2026

Added sv_maprotationcurrent check
when using the !nm command, the map was not detected correctly, but it is now fixed and works well

Added sv_maprotationcurrent check
{
// Parse format: "gametype sd map mp_bloc ..."
var pattern = @"^\s*(?:gametype\s+([a-z]+)\s+)?map\s+([a-z0-9_.-]+)\s*(.*)$";
var match = Regex.Match(currentRotation.Value.ToLower(), pattern, RegexOptions.IgnoreCase);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wether or not to use regex to parse the map rotation is a question I'll leave to the maintainers
(the clients do not waste resources using regex: see iw4x-client map rotation.cpp, it's just easier to split the string by spaces and read the first token pair for map ).
Anyhow, you are already ignoring the case with the regex function so calling tolower() is a wasteful operation.

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.

2 participants