Possibly fixes a bug where koopas could split into two shells under specific circumstances. (I'm not quite precise enough with timing to repro it myself 😖)
Ticket &70cff suggests that the problem occurs when a stomp and spin both hit the koopa at once. A code review bears this theory out: if both the stomp and strike functions run in the same frame, the spawn-shell-and-delete-self function into_shell is called both times.
To fix this, I modified into_shell to do nothing if the koopa is queued for deletion (which it always will be after the function is called once). I could easily have modified the call sites instead, but this way there's only one new if statement, not two, and no extra thought is required when using into_shell in the future.
Issue(s)
Theoretically closes ticket &70cff, and a longstanding bug noticed by several people on Discord (@nyanpasu64 and possibly Vexxter).
Description of changes
Possibly fixes a bug where koopas could split into two shells under specific circumstances. (I'm not quite precise enough with timing to repro it myself 😖)
Ticket &70cff suggests that the problem occurs when a stomp and spin both hit the koopa at once. A code review bears this theory out: if both the stomp and strike functions run in the same frame, the spawn-shell-and-delete-self function
into_shell
is called both times.To fix this, I modified
into_shell
to do nothing if the koopa is queued for deletion (which it always will be after the function is called once). I could easily have modified the call sites instead, but this way there's only one new if statement, not two, and no extra thought is required when usinginto_shell
in the future.Issue(s)
Theoretically closes ticket &70cff, and a longstanding bug noticed by several people on Discord (@nyanpasu64 and possibly Vexxter).