ignore quote at start of scen name alphabetical

This commit is contained in:
2025-08-02 09:34:25 -05:00
committed by Celtic Minstrel
parent 1ea170900e
commit 55257ab995

View File

@@ -341,6 +341,8 @@ std::string name_alphabetical(std::string a) {
// The scenario editor will let you prepend whitespace to a scenario name :(
boost::algorithm::trim_left(a);
std::transform(a.begin(), a.end(), a.begin(), tolower);
// Some party makers start with the name of the corresponding scenario in quotes
if(a.substr(0,1) == "\"") a.erase(a.begin(), a.begin() + 1);
if(a.substr(0,2) == "a ") a.erase(a.begin(), a.begin() + 2);
else if(a.substr(0,4) == "the ") a.erase(a.begin(), a.begin() + 4);
return a;