From a2cdefb3697b944faff5c500d4689d2bf2811192 Mon Sep 17 00:00:00 2001 From: Jaime Humberto Macias Bustamante Date: Thu, 3 Jul 2025 02:44:53 -0700 Subject: [PATCH] static fixes :3 --- hscript/CustomClassHandler.hx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hscript/CustomClassHandler.hx b/hscript/CustomClassHandler.hx index 12de0fd..efc3966 100644 --- a/hscript/CustomClassHandler.hx +++ b/hscript/CustomClassHandler.hx @@ -44,7 +44,7 @@ class CustomClassHandler implements IHScriptCustomConstructor implements IHScrip __interp.errorHandler = ogInterp.errorHandler; __interp.importFailedCallback = ogInterp.importFailedCallback; - __interp.variables = ogInterp.variables; + //__interp.variables = ogInterp.variables; __interp.publicVariables = ogInterp.publicVariables; __interp.staticVariables = ogInterp.staticVariables; __interp.customClasses = ogInterp.customClasses; @@ -66,11 +66,15 @@ class CustomClassHandler implements IHScriptCustomConstructor implements IHScrip } if(staticField && validField) { - __interp.expr(e); + __interp.exprReturn(e); __staticFields.push(fieldName); fields.remove(e); } } + + for(f => v in ogInterp.variables) + if(!__interp.variables.exists(f)) + __interp.variables.set(f, v); } public function hnew(args:Array):Dynamic