Skip to content

Commit

Permalink
FlxAssetPaths: fix filterExtensions for files with multiple dots (#2107)
Browse files Browse the repository at this point in the history
Previously getFileReferences filtered extensions using the first string after a dot. This means that myfile.png.old is included even when a filter is set to only import png files. This causes various compiler errors when tortoisesvn is used, due to duplicate file.ext.svn-base files being added. 

New implementation takes the *last* string after a dot, meaning that myfile.png.old is treated as a .old file and will not be included if "old" is not on the filter list.
  • Loading branch information
6J7KZg2f authored and Gama11 committed Sep 10, 2017
1 parent 574ff1b commit bb42acc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flixel/system/macros/FlxAssetPaths.hx
Expand Up @@ -47,7 +47,7 @@ class FlxAssetPaths

if (filterExtensions != null)
{
var extension:String = name.split(".")[1]; // get the string after the dot
var extension:String = name.split(".").last(); // get the last string with a dot before it
if (filterExtensions.indexOf(extension) == -1)
continue;
}
Expand Down Expand Up @@ -83,4 +83,4 @@ private class FileReference
this.documentation = "\"" + value + "\" (auto generated).";
}
}
#end
#end

0 comments on commit bb42acc

Please sign in to comment.