diff --git a/include/cserver/engine/components.hpp b/include/cserver/engine/components.hpp index a4fcdd4..9c277eb 100644 --- a/include/cserver/engine/components.hpp +++ b/include/cserver/engine/components.hpp @@ -133,9 +133,15 @@ struct ServiceContextForComponent { }; template - constexpr auto FindComponent() -> decltype(FindComponent()) { - return this->FindComponent(); + constexpr auto FindComponent() -> auto& + requires (Name == kBasicTaskProcessorName || requires {this->FindComponent();}) { + if constexpr(Name == kBasicTaskProcessorName) { + return this->context.taskProcessor; + } else { + return this->FindComponent(); + }; }; + template