diff --git a/source/core/textures/buildtiles.cpp b/source/core/textures/buildtiles.cpp index b08a70b0d..5a4c39554 100644 --- a/source/core/textures/buildtiles.cpp +++ b/source/core/textures/buildtiles.cpp @@ -598,13 +598,14 @@ void artClearMapArt(void) void artSetupMapArt(const char* filename) { - if (currentMapArt.CompareNoCase(filename)) return; - currentMapArt = filename; - artClearMapArt(); - - FString lcfilename = filename; + FString lcfilename = StripExtension(filename); lcfilename.MakeLower(); + if (currentMapArt.CompareNoCase(lcfilename) == 0) return; + artClearMapArt(); + currentMapArt = lcfilename; + + // Re-get from the texture manager if this map's tiles have already been created. if (TileFiles.maptilesadded.Find(lcfilename) < TileFiles.maptilesadded.Size()) { @@ -634,7 +635,7 @@ void artSetupMapArt(const char* filename) for (bssize_t i = 0; i < MAXARTFILES_TOTAL - MAXARTFILES_BASE; i++) { - FStringf fullname("%s_%02d.art", filename, i); + FStringf fullname("%s_%02d.art", lcfilename.GetChars(), i); TileFiles.LoadArtFile(fullname, filename); } }