Fix macro ecs_component_field_ref

This commit is contained in:
madpwnhammer 2022-12-03 15:52:02 +03:00
parent 304356aad7
commit f8647ffbdf
1 changed files with 9 additions and 6 deletions

View File

@ -829,8 +829,8 @@
{%- macro ecs_component_field_ref(o, f) ~%}
{
cl.Define(new FieldSymbol("{{f.name}}", {{f.type|bhl_type_ref}},
//getter
{%- if token_or(f, 'bhl_get', 1) != 0 ~%}
//getter
delegate(VM.Frame frm, Val ctx, ref Val v, FieldSymbol fld) {
#if !BHL_FRONT
@ -840,13 +840,15 @@
{{ _self.native2val(f.type, 'f.' ~ f.name, 'v') }};
#endif
},
}
{% else %}
null,
//getter not allowed
null
{% endif %}
//setter
,
{%- if token_or(f, 'bhl_set', 1) != 0 ~%}
//setter
delegate(VM.Frame frm, ref Val ctx, Val v, FieldSymbol fld) {
#if !BHL_FRONT
@ -858,7 +860,8 @@
#endif
}
{% else %}
null,
//setter not allowed
null
{% endif %}
));