REPENTOGON icon indicating copy to clipboard operation
REPENTOGON copied to clipboard

[Vanilla Bug] Fix Callback Iteration problems caused by the RemoveCallback function

Open Guantol-Lemat opened this issue 1 year ago • 1 comments

Whenever the RemoveCallback function (be it from the ModReference or the Isaac class) is used to remove a function from a Callback that is currently running, it results in the next callback function not being invoked.

The behavior is the exact same as attempting to use table.remove on a table that is currently being iterated over using ipairs, meaning that the problem only occurs if the function that is being removed has a higher or the same order as the function currently being executed.

To better illustrate this issue, I attached a code snippet demonstrating the problem scenario code snippet

Guantol-Lemat avatar Feb 06 '24 13:02 Guantol-Lemat

My apologies, you actually opened this one first, so you win

ConnorForan avatar May 24 '24 13:05 ConnorForan

Fixed in https://github.com/TeamREPENTOGON/REPENTOGON/commit/8234c37b67ce104100281a69aa78ce405aaa508a

ConnorForan avatar Sep 07 '24 00:09 ConnorForan