diff --git a/NifFile.cpp b/NifFile.cpp index de89e7cf..cbf2b7ff 100644 --- a/NifFile.cpp +++ b/NifFile.cpp @@ -537,6 +537,7 @@ void NifFile::TrimTexturePaths() { for (int i = 0; i < 9; i++) { if (GetTextureForShape(s, tFile, i) && !tFile.empty()) { tFile = regex_replace(tFile, regex("/+|\\\\+"), "\\"); // Replace multiple slashes or forward slashes with one backslash + tFile = regex_replace(tFile, regex("^\\\\+", regex_constants::icase), ""); // Remove all backslashes from the front tFile = regex_replace(tFile, regex(".*?Data\\\\", regex_constants::icase), ""); // Remove everything before and including the data path root tFile = regex_replace(tFile, regex("^(?!^textures\\\\)", regex_constants::icase), "textures\\"); // Add textures root path if not existing SetTextureForShape(s, tFile, i);