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)