From 4e318232c3d7798db9b3390bd532c6dc08cc9a20 Mon Sep 17 00:00:00 2001 From: wrenge Date: Tue, 7 May 2024 17:17:03 +0300 Subject: [PATCH] generation fixes --- src/codegen.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/codegen.inc.php b/src/codegen.inc.php index b679c17..98d0dd1 100644 --- a/src/codegen.inc.php +++ b/src/codegen.inc.php @@ -440,7 +440,7 @@ function var_sync($fname, \mtgType $type, $buf, array $tokens, $opts) { $str .= "int __tmp_{$fname} = (int)$fname;\n"; $str .= "MetaIO.Sync({$buf}, ref __tmp_{$fname}, \"{$key_name}\", {$opts});\n"; - $str .= "if($buf.is_read) {$fname} = ({$type->getName()})__tmp_{$fname};\n"; + $str .= "if($buf.is_read) {$fname} = (".cs_type($type).")__tmp_{$fname};\n"; } else if($type instanceof \mtgArrType) {