From 4b3dbb220623add26d850f37479b06943d066ce8 Mon Sep 17 00:00:00 2001 From: Pavel Shevaev Date: Tue, 28 Mar 2023 19:56:08 +0300 Subject: [PATCH] Fixing bug related to global types assignment order --- tpl/codegen_autobind.twig | 5 +++-- tpl/macro.twig | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tpl/codegen_autobind.twig b/tpl/codegen_autobind.twig index 8a5a36b..c86b459 100644 --- a/tpl/codegen_autobind.twig +++ b/tpl/codegen_autobind.twig @@ -24,10 +24,11 @@ static public class BHL_AutoBindings { public static void Register(Types types) { - BHL_Types.Type_GenericArray = new GenericArrayTypeSymbol(new Proxy()); - {% block register %} {{ macro.call_reg_units(slice_units(meta.units, 20)) }} + + BHL_Types.Type_GenericArray = new GenericArrayTypeSymbol(new Proxy()); + {{ macro.assign_global_types(meta.units) }} {% endblock %} } diff --git a/tpl/macro.twig b/tpl/macro.twig index 844996b..069f876 100644 --- a/tpl/macro.twig +++ b/tpl/macro.twig @@ -1030,7 +1030,9 @@ public partial class Script_{{u.object.name}} { {%- endif -%} {%- endfor ~%} +{%- endmacro -%} +{%- macro assign_global_types(units) ~%} //assign global static types {%- for u in units -%} {%- if u.object is instanceof('\\mtgMetaStruct') ~%} @@ -1047,6 +1049,4 @@ public partial class Script_{{u.object.name}} { {%- endif -%} {%- endfor -%} - {%- endmacro -%} -