ref: 3b7f2a6828897345ece7fc6227f07667d4f2b052
parent: 3da7cb4231ab12fc937c34405d888bca2bab03c4
author: Snesrev <[email protected]>
date: Mon Oct 17 23:24:11 EDT 2022
Don't grab any absorbable under a rock with the hookshot (#126)
--- a/sprite.c
+++ b/sprite.c
@@ -1427,8 +1427,14 @@
return false;
if (sprite_delay_aux2[k] != 0)
Oam_AllocateFromRegionC(12);
- if (sprite_E[k] != 0)
+ if (sprite_E[k] != 0) {
+ // This code runs when an absorbable is hidden under say a rock.
+ // sprite_B holds the sprite that grabbed us with a hookshot.
+ // Cancel the grab if we're hidden.
+ if (enhanced_features0 & kFeatures0_MiscBugFixes)
+ sprite_B[k] = 0;
return true;
+ }
uint8 j = sprite_type[k];
assert(j >= 0xd8 && j < 0xd8 + 19);
uint8 a = kAbsorbable_Tab2[j - 0xd8];
--- a/sprite_main.c
+++ b/sprite_main.c
@@ -11806,13 +11806,8 @@
if (!sprite_ai_state[k]) {
if (!player_is_indoors)
sprite_obj_prio[k] = 48;
- if (SpriteDraw_AbsorbableTransient(k, true)) {
- // sprite_B holds the sprite that grabbed us.
- // Cancel the grab if we're hidden under a rock.
- if (enhanced_features0 & kFeatures0_MiscBugFixes)
- sprite_B[k] = 0;
+ if (SpriteDraw_AbsorbableTransient(k, true))
return;
- }
}
Fairy_CheckIfTouchable(k);
if (Sprite_ReturnIfInactive(k))