]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Optimize the redundancy check and ignore color codes (they're stripped anyway)
authorMario <mario@smbclan.net>
Sun, 21 Oct 2018 17:06:58 +0000 (03:06 +1000)
committerMario <mario@smbclan.net>
Sun, 21 Oct 2018 17:06:58 +0000 (03:06 +1000)
qcsrc/common/mapinfo.qc

index 62e03d21b6fe8ed4fe375ea60d845636bcc420d7..68c548aaef9ea5034a7b1914c6aa056c905e931a 100644 (file)
@@ -724,23 +724,19 @@ void _MapInfo_Parse_Settemp(string pFilename, string acl, float type, string s,
 float MapInfo_isRedundant(string fn, string t)
 {
        // normalize file name
-       fn = strreplace("_", "-", fn);
+       fn = strreplace("_", "", fn);
+       fn = strreplace("-", "", fn);
 
        // normalize visible title
-       t = strreplace(": ", "-", t);
-       t = strreplace(":", "-", t);
-       t = strreplace(" ", "-", t);
-       t = strreplace("_", "-", t);
-       t = strreplace("'", "-", t);
-
-       if(!strcasecmp(fn, t))
-               return true;
+       t = strreplace(":", "", t);
+       t = strreplace(" ", "", t);
+       t = strreplace("_", "", t);
+       t = strreplace("-", "", t);
+       t = strreplace("'", "", t);
+       t = strdecolorize(t);
 
        // we allow the visible title to have punctuation the file name does
        // not, but not vice versa
-       t = strreplace("-", "", t);
-       fn = strreplace("-", "", fn);
-
        if(!strcasecmp(fn, t))
                return true;