Migrating to more robust bhl_custom_rw semantics

This commit is contained in:
Pavel Shevaev 2024-12-28 15:21:08 +03:00
parent 64d00bee4c
commit d3678bb8b9
1 changed files with 2 additions and 4 deletions

View File

@ -57,15 +57,13 @@ class BindEclLitePlugin implements \bhl_bind\BindPlugin
$code .= "#if !BHL_FRONT\n";
$code .= "public static bool TryUnpackEcsEntity(ValStack stack, out EcsWorld world, out int id)\n";
$code .= "{\n";
$code .= " EcsPackedEntityWithWorld e = default;\n";
$code .= " stack.PopRelease().Decode(ref e);\n\n";
$code .= " var e = stack.PopRelease().Decode(new EcsPackedEntityWithWorld());\n\n";
$code .= " return e.Unpack(out world, out id);\n";
$code .= "}\n\n";
$code .= "public static void UnpackEcsEntity(ValStack stack, out EcsWorld world, out int id)\n";
$code .= "{\n";
$code .= " EcsPackedEntityWithWorld e = default;\n";
$code .= " stack.PopRelease().Decode(ref e);\n\n";
$code .= " var e = stack.PopRelease().Decode(new EcsPackedEntityWithWorld());\n\n";
$code .= " if(e.Unpack(out world, out id) == false)\n";
$code .= " throw new Exception(\"No entity found\");\n";
$code .= "}\n\n";