diff options
author | N <71219152+PokeCodec@users.noreply.github.com> | 2021-01-16 20:29:42 -0500 |
---|---|---|
committer | N <71219152+PokeCodec@users.noreply.github.com> | 2021-01-16 20:29:42 -0500 |
commit | 26246ce2812a10c442a914f5d916b2e6d7637e7e (patch) | |
tree | 70c4f0343bcff645b383eee64a22ebd23ca681ba /src/task.c | |
parent | 926ef40c5266d3135e197bb9532360811bf9a399 (diff) |
Update task.c
Diffstat (limited to 'src/task.c')
-rw-r--r-- | src/task.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/task.c b/src/task.c index e0db8b6fa..ee58ba47c 100644 --- a/src/task.c +++ b/src/task.c @@ -139,14 +139,18 @@ void TaskDummy(u8 taskId) #define TASK_SPACE NUM_TASKS - 2 // So we can insert the two tasks at the last two array elements void SetTaskFuncWithFollowupFunc(u8 taskId, TaskFunc func, TaskFunc followupFunc) { - gTasks[taskId].data[TASK_SPACE] = (s16)((u32)followupFunc); - gTasks[taskId].data[TASK_SPACE + 1] = (s16)((u32)followupFunc >> 16); + u8 taskNum = TASK_SPACE; // Should be const + + gTasks[taskId].data[taskNum] = (s16)((u32)followupFunc); + gTasks[taskId].data[taskNum + 1] = (s16)((u32)followupFunc >> 16); gTasks[taskId].func = func; } void SwitchTaskToFollowupFunc(u8 taskId) { - gTasks[taskId].func = (TaskFunc)((u16)(gTasks[taskId].data[TASK_SPACE]) | (gTasks[taskId].data[TASK_SPACE + 1] << 16)); + u8 taskNum = TASK_SPACE; // Should be const + + gTasks[taskId].func = (TaskFunc)((u16)(gTasks[taskId].data[taskNum]) | (gTasks[taskId].data[taskNum + 1] << 16)); } bool8 FuncIsActiveTask(TaskFunc func) @@ -168,7 +172,7 @@ u8 FindTaskIdByFunc(TaskFunc func) if (gTasks[i].isActive == TRUE && gTasks[i].func == func) return (u8)i; - return TAIL_SENTINEL; //No task found + return TAIL_SENTINEL; // No task found } u8 GetTaskCount(void) |