Textures with whitespace at the beginning or end are now handled correctly. Fixes #522

This commit is contained in:
biwa 2021-01-30 23:44:42 +01:00
parent 4eb223b3f0
commit 4f9111d075

View file

@ -133,8 +133,9 @@ namespace CodeImp.DoomBuilder.IO
//mxd. This returns (hopefully) unique hash value for a texture name of any length
public static long MakeLongName(string name, bool uselongnames)
{
name = name.Trim().ToUpper();
if(!uselongnames && name.Length > DataManager.CLASIC_IMAGE_NAME_LENGTH)
// biwa. is using ToUpper a good idea? Will result in clashes with same names with different cases
name = name.ToUpper();
if (!uselongnames && name.Length > DataManager.CLASIC_IMAGE_NAME_LENGTH)
{
name = name.Substring(0, DataManager.CLASIC_IMAGE_NAME_LENGTH);
}