diff --git a/src/codegen.inc.php b/src/codegen.inc.php index d5231e6..b13d2b5 100644 --- a/src/codegen.inc.php +++ b/src/codegen.inc.php @@ -476,9 +476,9 @@ function get_diff_related_units(\mtgMetaStruct $struct) if($field->hasToken('nodiff')) continue; - if($field->getType() instanceof mtgMetaStruct) + if($field->getType() instanceof \mtgMetaStruct) $result[] = $field->getType(); - else if($field->getType() instanceof mtgArrType) + else if($field->getType() instanceof \mtgArrType) $result[] = $field->getType()->getValue(); } return $result; diff --git a/tpl/macro.twig b/tpl/macro.twig index f555852..c127bb7 100644 --- a/tpl/macro.twig +++ b/tpl/macro.twig @@ -489,15 +489,15 @@ public class {{o.name}} : IRpc { bool is_equal = true; - {%- if has_token(o, 'bitfields') ~%} + {%- if has_token(u, 'bitfields') ~%} a.ResetFieldMask(); {%- endif -%} - {%- for f in o.fields ~%} - {{_self.field_compare(o, f, loop.index0)}} + {%- for f in u.fields ~%} + {{_self.field_compare(u, f, loop.index0)}} {%- endfor -%} - {%- if has_token(o, 'bitfields') ~%} + {%- if has_token(u, 'bitfields') ~%} if(!is_equal) a.SetPrimaryFieldsChanged(); {%- endif -%} @@ -508,8 +508,8 @@ public class {{o.name}} : IRpc {% endmacro %} {% macro compare_func_name(o) %} -{{has_token(u, 'bitfields')?'CompareAndMarkFields':'IsEqual'}} -{% endmacro %} +{{has_token(o, 'bitfields')?'CompareAndMarkFields':'IsEqual'}} +{%- endmacro %} {%- macro field_compare(o, f, field_idx) -%}