diff --git a/src/KingSystem/Utils/Thread/TaskMgr.h b/src/KingSystem/Utils/Thread/TaskMgr.h index b200e5f1..8b94e53e 100644 --- a/src/KingSystem/Utils/Thread/TaskMgr.h +++ b/src/KingSystem/Utils/Thread/TaskMgr.h @@ -42,8 +42,8 @@ public: void init(s32 num_tasks, sead::Heap* heap, ManagedTaskFactory& factory); template - void init(s32 num_tasks, sead::Heap* heap) { - initImpl_(num_tasks, heap); + void init(s32 num_tasks, sead::Heap* heap, bool check_task_type = false) { + initImpl_(num_tasks, heap, check_task_type); } void finalize(); @@ -87,11 +87,11 @@ protected: } template - void initImpl_(s32 num_tasks, sead::Heap* heap) { + void initImpl_(s32 num_tasks, sead::Heap* heap, bool check_task_type) { sead::Delegate1 factory{this, &TaskMgr::makeTaskType_}; init(num_tasks, heap, factory); - if (hasTasks()) { + if (check_task_type && hasTasks()) { Task* task = nullptr; if (mFreeTaskLists[0].size() >= 1) task = mFreeTaskLists[0].front();