Update task.c

This commit is contained in:
N 2021-01-17 12:49:50 -05:00 committed by GitHub
parent ad6ab09e30
commit 8297090267
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -141,7 +141,7 @@ void SetTaskFuncWithFollowupFunc(u8 taskId, TaskFunc func, TaskFunc followupFunc
u8 followupFuncIndex = NUM_TASK_DATA - 2; // Should be const.
gTasks[taskId].data[followupFuncIndex] = (s16)((u32)followupFunc);
gTasks[taskId].data[followupFuncIndex + 1] = (s16)((u32)followupFunc >> 16);
gTasks[taskId].data[followupFuncIndex + 1] = (s16)((u32)followupFunc >> 16); // So we can store the followupFunc in two adjacent indexes.
gTasks[taskId].func = func;
}
@ -198,7 +198,7 @@ void SetWordTaskArg(u8 taskId, u8 dataElem, u32 value)
u32 GetWordTaskArg(u8 taskId, u8 dataElem)
{
if (dataElem < NUM_TASK_DATA - 1)
return (u16)gTasks[taskId].data[dataElem] | (gTasks[taskId].data[dataElem + 1] << 16);
return (u16)gTasks[taskId].data[dataElem] | (gTasks[taskId].data[dataElem + 1] << 16); // Merge the two adjacent indexes back
else
return 0;
}