Tweaking native array proxies codegen

This commit is contained in:
Madpwnhammer 2022-12-14 12:55:52 +03:00
parent 0a98a1cb6b
commit 15f762cd16
2 changed files with 3 additions and 3 deletions

View File

@ -51,7 +51,7 @@ function bhl_prepare_meta(\mtgMetaInfo $orig)
$arr_proxies = array();
foreach($meta->getUnits() as $u)
{
if($u->object instanceof \mtgMetaStruct)
if($u->object instanceof \mtgMetaStruct && !$u->object->hasToken('bhl_ecs_component'))
{
$need_to_replace = false;
$fields = $u->object->getFields();

View File

@ -513,14 +513,14 @@ Script_{{o.name|norm_name}}.Method_{{m.name}}.ReturnValue(frm, stack
cl.Define(vs);
}
{
var fn = new FuncSymbolNative("At", types.T("{{o.name}}"),
var fn = new FuncSymbolNative("At", types.T("{{token(o, 'bhl_native_arr_proxy').name}}"),
delegate(VM.Frame frm, ValStack stack, FuncArgsInfo args_info, ref BHS status)
{
#if !BHL_FRONT
var val_idx = stack.Pop();
var val_lst = stack.Pop();
var v = ((List<{{token(o, 'bhl_native_arr_proxy').name}}>)val_lst.obj)[(int)val_idx._num];
var v = ((List<{{token(o, 'bhl_native_arr_proxy')|native_type}}>)val_lst.obj)[(int)val_idx._num];
var dv = Val.New(frm.vm);
{{ _self.native2val(token(o, 'bhl_native_arr_proxy'), 'v', 'dv') }};