From 2e76148fba396e8c0e3fc0dc8ad632e0726e059d Mon Sep 17 00:00:00 2001 From: ackwell Date: Fri, 3 May 2024 21:14:40 +1000 Subject: [PATCH] Ensure materials end in .mtrl --- Penumbra/UI/AdvancedWindow/ModEditWindow.Models.MdlTab.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Penumbra/UI/AdvancedWindow/ModEditWindow.Models.MdlTab.cs b/Penumbra/UI/AdvancedWindow/ModEditWindow.Models.MdlTab.cs index b8c0176a..b3460667 100644 --- a/Penumbra/UI/AdvancedWindow/ModEditWindow.Models.MdlTab.cs +++ b/Penumbra/UI/AdvancedWindow/ModEditWindow.Models.MdlTab.cs @@ -290,10 +290,13 @@ public partial class ModEditWindow /// While materials can be relative (`/mt_...`) or absolute (`bg/...`), /// they invariably must contain at least one directory seperator. /// Missing this can lead to a crash. + /// + /// They must also be at least one character (though this is enforced + /// by containing a `/`), and end with `.mtrl`. /// public bool ValidateMaterial(string material) { - return material.Contains('/'); + return material.Contains('/') && material.EndsWith(".mtrl"); } /// Remove the material given by the index.