From 1b676441975267a629948efc9479acda3cc1325f Mon Sep 17 00:00:00 2001 From: Nairda <38843773+Nairdaa@users.noreply.github.com> Date: Mon, 23 Sep 2024 03:36:25 +0200 Subject: [PATCH] Clarify logic for testing writeability with faketestfile_69.replay (#1217) * Update replay-stocks.sp * Update replay-stocks.sp XDDD * Update replay-stocks.sp ecksdee. * Update replay-stocks.sp f.. you * Update replay-stocks.sp hucvfrsdtbh --- .../sourcemod/scripting/include/shavit/replay-stocks.sp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/addons/sourcemod/scripting/include/shavit/replay-stocks.sp b/addons/sourcemod/scripting/include/shavit/replay-stocks.sp index 8f0bd0a61..34e0098bb 100644 --- a/addons/sourcemod/scripting/include/shavit/replay-stocks.sp +++ b/addons/sourcemod/scripting/include/shavit/replay-stocks.sp @@ -86,13 +86,18 @@ stock void Shavit_Replay_CreateDirectories(const char[] sReplayFolder, int style } } - // Test to see if replay file creation even works... + // Test to see if replay file creation works FormatEx(sPath, sizeof(sPath), "%s/0/faketestfile_69.replay", sReplayFolder); File fTest = OpenFile(sPath, "wb+"); - CloseHandle(fTest); + // Check if the file was opened successfully for writing if (fTest == null) { SetFailState("Failed to write to replay folder (%s). Make sure you have file permissions.", sReplayFolder); } + else + { + // File was opened successfully, now close it + CloseHandle(fTest); + } }