From 33fe8776bb80f40667e5d90933910a7fbad5e2bc Mon Sep 17 00:00:00 2001 From: Adam Bird Date: Tue, 28 Nov 2023 20:02:45 -0500 Subject: [PATCH] Fix bugs dont despawn cheat to work with soil patches (#3457) --- soh/src/overlays/actors/ovl_En_Insect/z_en_insect.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/soh/src/overlays/actors/ovl_En_Insect/z_en_insect.c b/soh/src/overlays/actors/ovl_En_Insect/z_en_insect.c index f1dff358a..393e10a91 100644 --- a/soh/src/overlays/actors/ovl_En_Insect/z_en_insect.c +++ b/soh/src/overlays/actors/ovl_En_Insect/z_en_insect.c @@ -211,6 +211,13 @@ void EnInsect_Init(Actor* thisx, PlayState* play2) { func_80A7D39C(this); + // For bugs that aren't linked to a soil patch, we remove the "short lived" flag to prevent them from despawning + // And exit early to not increment the "bugs dropped count" + if (CVarGetInteger("gNoBugsDespawn", 0) && this->soilActor == NULL) { + this->unk_314 &= ~4; + return; + } + D_80A7DEB8++; } else { rand = Rand_ZeroOne(); @@ -394,9 +401,6 @@ void func_80A7CAD0(EnInsect* this, PlayState* play) { } void func_80A7CBC8(EnInsect* this) { - if (CVarGetInteger("gNoBugsDespawn", 0) != 0) { - return; - } this->unk_31A = 60; func_80A7BF58(this); this->skelAnime.playSpeed = 1.9f;