From a2a12f121ec388703f003f53dd4be689402099cd Mon Sep 17 00:00:00 2001 From: SrtHero278 Date: Mon, 25 Nov 2024 11:33:48 -0800 Subject: [PATCH] quick fix 2 classes not using the correct line number. --- source/funkin/backend/scripting/HScript.hx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/funkin/backend/scripting/HScript.hx b/source/funkin/backend/scripting/HScript.hx index 37aaaa95..0597a32f 100644 --- a/source/funkin/backend/scripting/HScript.hx +++ b/source/funkin/backend/scripting/HScript.hx @@ -74,8 +74,10 @@ class HScript extends Script { var code = Assets.getText(p); var expr:Expr = null; try { - if (code != null && code.trim() != "") + if (code != null && code.trim() != "") { + parser.line = 1; // fun fact: this is all you need to reuse a parser without issues. all the other vars get reset on parse. expr = parser.parseString(code, cl.join("/") + "." + hxExt); + } } catch(e:Error) { _errorHandler(e); } catch(e) {