shithub: zelda3

Download patch

ref: 57bb4e82829a37d0229686850325758cefeb4c1d
parent: d634b1f7523a10f2de4e59147afe2720e3716fe4
author: Snesrev <snesrev@protonmail.com>
date: Tue Sep 20 10:23:34 EDT 2022

Fix issues with Bee not working right.

--- a/player.c
+++ b/player.c
@@ -2421,8 +2421,8 @@
       goto fail;
     link_bottle_info[btidx] = 2;
     Hud_Rebuild();
-  } else if (b == 7) {  // bee
-    if (!ReleaseBeeFromBottle())
+  } else if (b == 7 || b == 8) {  // bad/good bee
+    if (!ReleaseBeeFromBottle(btidx))
       goto fail;
     link_bottle_info[btidx] = 2;
     Hud_Rebuild();
--- a/sprite_main.c
+++ b/sprite_main.c
@@ -24281,11 +24281,11 @@
   sprite_y_vel[k] = kSpawnBee_InitVel[GetRandomNumber() & 7];
 }
 
-int ReleaseBeeFromBottle() {  // 9edccf
+int ReleaseBeeFromBottle(int x_value) {  // 9edccf
   static const int8 kSpawnBee_XY[8] = {8, 2, -2, -8, 10, 5, -5, -10};
 
   SpriteSpawnInfo info;
-  int j = Sprite_SpawnDynamically(0, 0xb2, &info);
+  int j = Sprite_SpawnDynamically(x_value, 0xb2, &info);
   if (j >= 0) {
     sprite_floor[j] = link_is_on_lower_level;
     Sprite_SetX(j, link_x_coord + 8);
@@ -24391,7 +24391,7 @@
     Point16U pt2;
     if (!PlayerBee_FindTarget(k, &pt2)) {
       pt2.x = link_x_coord + (GetRandomNumber() & 3) * 5;
-      pt2.x = link_y_coord + (GetRandomNumber() & 3) * 5;
+      pt2.y = link_y_coord + (GetRandomNumber() & 3) * 5;
     }
     if ((k ^ frame_counter) & 7)
       return;
--- a/sprite_main.h
+++ b/sprite_main.h
@@ -873,7 +873,7 @@
 void Bee_DormantHive(int k);
 void SpawnBeeFromHive(int k);
 void InitializeSpawnedBee(int k);
-int ReleaseBeeFromBottle();
+int ReleaseBeeFromBottle(int x_value);
 void Bee_Main(int k);
 int Sprite_Find_EmptyBottle();
 void Bee_HandleInteractions(int k);