From f2ec8da540626f427e687876532e0dee3f8c515c Mon Sep 17 00:00:00 2001 From: Ne_Eo Date: Thu, 3 Oct 2024 00:37:35 +0200 Subject: [PATCH] Small change to flags --- source/funkin/backend/system/Flags.hx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/source/funkin/backend/system/Flags.hx b/source/funkin/backend/system/Flags.hx index fed62113..25d13ebf 100644 --- a/source/funkin/backend/system/Flags.hx +++ b/source/funkin/backend/system/Flags.hx @@ -30,9 +30,9 @@ class Flags { var splitContent = [for(e in data.split("\n")) if ((trimmed = e.trim()) != "") trimmed]; for(line in splitContent) { - if (line.startsWith(";")) continue; - if (line.startsWith("#")) continue; - if (line.startsWith("//")) continue; + if(line.startsWith(";")) continue; + if(line.startsWith("#")) continue; + if(line.startsWith("//")) continue; if(line.length == 0) continue; if(line.charAt(0) == "[" && line.charAt(line.length-1) == "]") continue; @@ -41,10 +41,9 @@ class Flags { var name = line.substr(0, index).trim(); var value = line.substr(index+1).trim(); - if (value.length > 1 && value.charCodeAt(0) == '"'.code && value.charCodeAt(value.length-1) == '"'.code) - value = value.substr(1, value.length - 2); - - if (value.length == 0 || name.length == 0) + var wasQuoted = value.length > 1 && value.charCodeAt(0) == '"'.code && value.charCodeAt(value.length-1) == '"'.code; + if(wasQuoted) value = value.substr(1, value.length - 2); + if((!wasQuoted && value.length == 0) || name.length == 0) continue; if(!flags.exists(name))