summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEblo <7004497+Eblo@users.noreply.github.com>2025-12-18 09:21:09 -0500
committerGitHub <noreply@github.com>2025-12-18 09:21:09 -0500
commita2e8b62def688528635da207f99b390b367c7ba8 (patch)
tree77ac41c425715b1aa18f3bcc9b85466a0d2337f6
parent4e22b5cde95f6b81e2d1db9c2c1d3b622bbb16b3 (diff)
Fix cow softlock when cows are not shuffled (#1396)
* Fix cow softlock when cows are not shuffled * Make the cow hooks themselves conditional
-rw-r--r--mm/2s2h/Rando/ActorBehavior/EnCow.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/mm/2s2h/Rando/ActorBehavior/EnCow.cpp b/mm/2s2h/Rando/ActorBehavior/EnCow.cpp
index cbd93de7f..59613416d 100644
--- a/mm/2s2h/Rando/ActorBehavior/EnCow.cpp
+++ b/mm/2s2h/Rando/ActorBehavior/EnCow.cpp
@@ -58,7 +58,9 @@ RandoCheckId IdentifyCow(Actor* actor) {
}
void Rando::ActorBehavior::InitEnCowBehavior() {
- COND_VB_SHOULD(VB_GIVE_ITEM_FROM_COW, IS_RANDO, {
+ bool shouldRegister = IS_RANDO && RANDO_SAVE_OPTIONS[RO_SHUFFLE_COWS];
+
+ COND_VB_SHOULD(VB_GIVE_ITEM_FROM_COW, shouldRegister, {
// Original Should is the Range check, if it fails just Return.
Actor* actor = va_arg(args, Actor*);
if (!((actor->xzDistToPlayer < 90.0f) &&
@@ -66,13 +68,15 @@ void Rando::ActorBehavior::InitEnCowBehavior() {
*should = false;
return;
}
+
+ ((EnCow*)actor)->flags |= EN_COW_FLAG_WONT_GIVE_MILK;
+
RandoCheckId randoCheckId = IdentifyCow(actor);
if (randoCheckId == RC_UNKNOWN) {
*should = true;
return;
}
- ((EnCow*)actor)->flags |= EN_COW_FLAG_WONT_GIVE_MILK;
RandoSaveCheck& randoSaveCheck = RANDO_SAVE_CHECKS[randoCheckId];
if (!randoSaveCheck.shuffled || randoSaveCheck.cycleObtained) {
@@ -83,7 +87,7 @@ void Rando::ActorBehavior::InitEnCowBehavior() {
*should = false;
});
- COND_VB_SHOULD(VB_COW_CONSIDER_EPONAS_SONG_PLAYED, IS_RANDO, {
+ COND_VB_SHOULD(VB_COW_CONSIDER_EPONAS_SONG_PLAYED, shouldRegister, {
EnCow* actor = va_arg(args, EnCow*);
if (actor->flags & EN_COW_FLAG_WONT_GIVE_MILK) {
gPlayState->msgCtx.songPlayed = 0;
@@ -91,7 +95,7 @@ void Rando::ActorBehavior::InitEnCowBehavior() {
*should = gPlayState->msgCtx.songPlayed == OCARINA_SONG_EPONAS;
});
- COND_ID_HOOK(ShouldActorInit, ACTOR_EN_COW, IS_RANDO, [](Actor* refActor, bool* should) {
+ COND_ID_HOOK(ShouldActorInit, ACTOR_EN_COW, shouldRegister, [](Actor* refActor, bool* should) {
RandoCheckId randoCheckId = IdentifyCow(refActor);
switch (randoCheckId) {
case RC_ROMANI_RANCH_BARN_COW_LEFT: