Merge pull request #8946 from MilkeeyCat/pr_fix_callvote_map_change

Don't add `/` if the directory is empty
This commit is contained in:
Robert Müller 2024-09-14 17:11:22 +00:00 committed by GitHub
commit 0369946156
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3526,7 +3526,7 @@ void CGameContext::ConAddMapVotes(IConsole::IResult *pResult, void *pUserData)
str_format(aCommand, sizeof(aCommand), "clear_votes; add_map_votes \"%s\"", aDirectory);
}
else
str_format(aCommand, sizeof(aCommand), "change_map \"%s/%s\"", pDirectory, aOptionEscaped);
str_format(aCommand, sizeof(aCommand), "change_map \"%s%s%s\"", pDirectory, pDirectory[0] == '\0' ? "" : "/", aOptionEscaped);
pSelf->AddVote(aDescription, aCommand);
}