From fa795772bf2e321b0064ccae3a900c83854a80b6 Mon Sep 17 00:00:00 2001 From: Pavel Shevaev Date: Tue, 26 Mar 2024 11:21:32 +0300 Subject: [PATCH] Using C# built-in initialization routines instead of MetaIO's methods --- src/codegen.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/codegen.inc.php b/src/codegen.inc.php index 7a5ffe2..0002dc3 100644 --- a/src/codegen.inc.php +++ b/src/codegen.inc.php @@ -350,7 +350,7 @@ function var_reset($name, \mtgType $type, $default = null) } else if($type instanceof \mtgArrType) { - $str = "MetaIO.ClearList(ref $name);"; + $str = "if($name == null) $name = new(); else $name.Clear();"; if($default) { @@ -390,7 +390,7 @@ function var_reset($name, \mtgType $type, $default = null) if($is_pod) $str .= "$name.Reset(); "; else - $str .= "MetaIO.Reset(ref $name); "; + $str .= "if($name == null) $name = new(); else $name.Reset(); "; } if($default)