Fix leak of shuffled fairy bottle-swipe behavior to other actors (#6405)

This commit is contained in:
Christopher Leggett 2026-03-24 19:37:21 +00:00 committed by GitHub
parent 5fe4680a20
commit 5e13570b83
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -106,11 +106,13 @@ void RegisterShuffleFairies() {
COND_VB_SHOULD(VB_BOTTLE_ACTOR, shouldRegister, {
Actor* actor = va_arg(args, Actor*);
const auto fairyIdentity = ObjectExtension::GetInstance().Get<CheckIdentity>(actor);
if (fairyIdentity != nullptr && fairyIdentity->randomizerInf != RAND_INF_MAX) {
Flags_SetRandomizerInf(fairyIdentity->randomizerInf);
actor->parent = &GET_PLAYER(gPlayState)->actor;
*should = false;
if (actor->id == ACTOR_EN_ELF) {
const auto fairyIdentity = ObjectExtension::GetInstance().Get<CheckIdentity>(actor);
if (fairyIdentity != nullptr && fairyIdentity->randomizerInf != RAND_INF_MAX) {
Flags_SetRandomizerInf(fairyIdentity->randomizerInf);
actor->parent = &GET_PLAYER(gPlayState)->actor;
*should = false;
}
}
});