From 1ce44e2bcefef2a8e35c7b14c85771cab86fd078 Mon Sep 17 00:00:00 2001 From: korenkonder Date: Tue, 9 Jan 2024 11:56:49 +0300 Subject: [PATCH] Idk how to comment this --- src/CRE/mdl/disp_manager.cpp | 2 +- src/CRE/task.cpp | 1 - src/CRE/task.hpp | 6 ++---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/CRE/mdl/disp_manager.cpp b/src/CRE/mdl/disp_manager.cpp index 0d47255b..b61e797c 100644 --- a/src/CRE/mdl/disp_manager.cpp +++ b/src/CRE/mdl/disp_manager.cpp @@ -2240,7 +2240,7 @@ namespace mdl { } void DispManager::draw(ObjType type, int32_t depth_mask, bool a4) { - if (get_obj_count(type) < 1) + if (type < 0 || type >= mdl::OBJ_TYPE_MAX || get_obj_count(type) < 1) return; render_context* rctx = rctx_ptr; diff --git a/src/CRE/task.cpp b/src/CRE/task.cpp index 4145d734..958af32a 100644 --- a/src/CRE/task.cpp +++ b/src/CRE/task.cpp @@ -343,7 +343,6 @@ namespace app { } static void Task_do_ctrl_frames(int32_t frames, bool frame_skip) { - std::list* tasks = &task_work->tasks; for (int32_t i = 0; i < 3; i++) for (Task*& j : task_work->tasks) { Task* tsk = j; diff --git a/src/CRE/task.hpp b/src/CRE/task.hpp index ac57a2f9..93523f66 100644 --- a/src/CRE/task.hpp +++ b/src/CRE/task.hpp @@ -81,10 +81,6 @@ namespace app { void set_priority(int32_t priority); }; - struct TaskWork; - - extern TaskWork* task_work; - struct TaskWork { std::list tasks; Task* current_task; @@ -111,6 +107,8 @@ namespace app { static bool has_tasks_dest(); }; + extern TaskWork* task_work; + extern void task_work_init(); extern void task_work_free(); }