From 18198fffe1c5cf0c3185917a57bc2725fdc4f0ee Mon Sep 17 00:00:00 2001 From: Fira Date: Sat, 3 Jun 2023 20:19:55 +0100 Subject: [PATCH 1/2] port /tg/ PR #75835 --- code/_byond_version_compat.dm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/code/_byond_version_compat.dm b/code/_byond_version_compat.dm index b5379a3b6d5c..880c50345323 100644 --- a/code/_byond_version_compat.dm +++ b/code/_byond_version_compat.dm @@ -47,3 +47,15 @@ /// Call by name proc reference, checks if the proc is existing global proc #define GLOBAL_PROC_REF(X) (/proc/##X) #endif + +#if (DM_VERSION == 515) +/// fcopy will crash on 515 linux if given a non-existant file, instead of returning 0 like on 514 linux or 515 windows +/// var case matches documentation for fcopy. +/world/proc/__fcopy(Src, Dst) + if (!fexists(Src)) + return 0 + return fcopy(Src, Dst) + +#define fcopy(Src, Dst) world.__fcopy(Src, Dst) + +#endif From 5e528355396eb307c1c994a11f7dac6b2dabad65 Mon Sep 17 00:00:00 2001 From: Fira Date: Sun, 4 Jun 2023 14:41:30 +0100 Subject: [PATCH 2/2] walter fix --- code/_byond_version_compat.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/_byond_version_compat.dm b/code/_byond_version_compat.dm index 880c50345323..f5ce60789626 100644 --- a/code/_byond_version_compat.dm +++ b/code/_byond_version_compat.dm @@ -52,7 +52,7 @@ /// fcopy will crash on 515 linux if given a non-existant file, instead of returning 0 like on 514 linux or 515 windows /// var case matches documentation for fcopy. /world/proc/__fcopy(Src, Dst) - if (!fexists(Src)) + if (istext(Src) && !fexists(Src)) return 0 return fcopy(Src, Dst)