From 95b83ffd6139aceff2d2446f1c38b73fd0c1bf6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20B=C3=A1lint=20Misius?= Date: Wed, 20 Dec 2023 19:13:37 +0100 Subject: [PATCH] Allow tpt.beginGetScript to overwrite existing files unconditionally It's not worth the trouble to ask questions (this was the old behaviour), the next best thing (in terms of preserving old behaviour) is to overwrite unconditionally. There is no situation in which the file name would be specified but the user wouldn't want the file to be written to. --- src/lua/LuaScriptInterface.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/lua/LuaScriptInterface.cpp b/src/lua/LuaScriptInterface.cpp index 1bc7b0730..b2398be46 100644 --- a/src/lua/LuaScriptInterface.cpp +++ b/src/lua/LuaScriptInterface.cpp @@ -4761,11 +4761,6 @@ void LuaScriptInterface::OnTick() complete({ GetScriptStatus::GetFailed{ ByteString(http::StatusText(ret)).FromUtf8() } }); return; } - if (Platform::FileExists(scriptDownloadFilename)) - { - complete({ GetScriptStatus::GetFailed{ "File already exists" } }); - return; - } if (!Platform::WriteFile(std::vector(scriptData.begin(), scriptData.end()), scriptDownloadFilename)) { complete({ GetScriptStatus::GetFailed{ "Unable to write to file" } });