diff --git a/Barotrauma/BarotraumaShared/SharedSource/LuaCs/LuaCsUtility.cs b/Barotrauma/BarotraumaShared/SharedSource/LuaCs/LuaCsUtility.cs index 84b9100b1..7591fca55 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/LuaCs/LuaCsUtility.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/LuaCs/LuaCsUtility.cs @@ -126,6 +126,22 @@ namespace Barotrauma File.WriteAllText(path, text); } + public static void Delete(string path) + { + if (!IsPathAllowedException(path)) + return; + + File.Delete(path); + } + + public static void DeleteDirectory(string path) + { + if (!IsPathAllowedException(path)) + return; + + Directory.Delete(path, true); + } + public static FileStream OpenRead(string path) { if (!IsPathAllowedException(path))