From 245619ab72cec05a01aa23308365688ffb5e70a5 Mon Sep 17 00:00:00 2001 From: Evil Factory <36804725+evilfactory@users.noreply.github.com> Date: Mon, 7 Mar 2022 16:29:32 -0300 Subject: [PATCH] added File.CreateDirectory --- .../BarotraumaShared/SharedSource/Lua/LuaClasses.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Barotrauma/BarotraumaShared/SharedSource/Lua/LuaClasses.cs b/Barotrauma/BarotraumaShared/SharedSource/Lua/LuaClasses.cs index e38575ead..6d13ffca1 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/Lua/LuaClasses.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/Lua/LuaClasses.cs @@ -652,6 +652,16 @@ namespace Barotrauma return File.Exists(path); } + public static bool CreateDirectory(string path) + { + if (!IsPathAllowedLuaException(path)) + return false; + + Directory.CreateDirectory(path); + + return true; + } + public static bool DirectoryExists(string path) { if (!IsPathAllowedLuaException(path))