From d3678bb8b929b8f49e7f632b34d74e439721423a Mon Sep 17 00:00:00 2001 From: Pavel Shevaev Date: Sat, 28 Dec 2024 15:21:08 +0300 Subject: [PATCH] Migrating to more robust bhl_custom_rw semantics --- src/bind.inc.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/bind.inc.php b/src/bind.inc.php index 9649001..aa3071e 100644 --- a/src/bind.inc.php +++ b/src/bind.inc.php @@ -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";