Fix UB: Destoyed task is modified.

After destruction, task is no longer used, so updating its values is worthless.
This commit is contained in:
gAlfonso-bit 2021-05-14 13:41:22 -04:00 committed by huderlem
parent f62b42eb59
commit ab8318cc79

View File

@ -4328,7 +4328,10 @@ static bool8 Phase2_FrontierSquaresScroll_Func5(struct Task *task)
BlendPalettes(PALETTES_ALL, 0x10, 0);
DestroyTask(FindTaskIdByFunc(task->func));
#ifndef UBFIX
task->tState++; // UB: changing value of a destroyed task
#endif
return FALSE;
}