From cd1f81127a1424a99d9a0e134fd9b8c673aa6492 Mon Sep 17 00:00:00 2001 From: Mergul Date: Sun, 23 Apr 2023 21:52:18 +0200 Subject: [PATCH] Workaround for issue with hasMember and opDispatch --- source/bubel/ecs/manager.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/bubel/ecs/manager.d b/source/bubel/ecs/manager.d index 5c343e6..f1edf5c 100644 --- a/source/bubel/ecs/manager.d +++ b/source/bubel/ecs/manager.d @@ -1305,7 +1305,7 @@ export struct EntityManager // static assert(0, "Add \"mixin ECS.Component;\" in top of component structure;"); // } - static if (hasMember!(Comp, "onDestroy") && isFunction!(Comp.onDestroy) + static if (__traits(hasMember, Comp.init, "onDestroy") && isFunction!(Comp.onDestroy) && is(ReturnType!(Comp.onDestroy) == void) && Parameters!(Comp.onDestroy).length == 0) { @@ -1317,7 +1317,7 @@ export struct EntityManager info.destroy_callback = &callDestroy; } - static if (hasMember!(Comp, "onCreate") && isFunction!(Comp.onCreate) + static if (__traits(hasMember, Comp.init, "onCreate") && isFunction!(Comp.onCreate) && is(ReturnType!(Comp.onCreate) == void) && Parameters!(Comp.onCreate).length == 0) { static void callCreate(void* pointer) nothrow @nogc