summaryrefslogtreecommitdiff
path: root/soh/src/code
diff options
context:
space:
mode:
authorbriaguya <70942617+briaguya-ai@users.noreply.github.com>2025-03-26 15:07:54 -0400
committerGitHub <noreply@github.com>2025-03-26 20:07:54 +0100
commit9ff49403a86c6c3b31dfc71a67e9f15d119459ed (patch)
tree2a8f4a1902b39a0d8022be90dd1f200dc3c46bbb /soh/src/code
parentf1a45cf2ecf8a87b03e3a209153fd7d779065d76 (diff)
shipinit (r)ba (#5025)
* RBA and BA * move rba to shipinit * make the vanilla condition actually a vanilla condition * update should docs * move ba to shipinit * don't pass things * try a different readability strategy * remove option/preset entries --------- Co-authored-by: rozlette <Rozelette@users.noreply.github.com>
Diffstat (limited to 'soh/src/code')
-rw-r--r--soh/src/code/z_parameter.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c
index 8c93b8a57..bf0ba6a1c 100644
--- a/soh/src/code/z_parameter.c
+++ b/soh/src/code/z_parameter.c
@@ -1517,8 +1517,10 @@ void Rando_Inventory_SwapAgeEquipment(void) {
(gSaveContext.equips.buttonItems[i] <= ITEM_POE)) ||
((gSaveContext.equips.buttonItems[i] >= ITEM_WEIRD_EGG) &&
(gSaveContext.equips.buttonItems[i] <= ITEM_CLAIM_CHECK))) {
- gSaveContext.equips.buttonItems[i] =
- gSaveContext.inventory.items[gSaveContext.equips.cButtonSlots[i - 1]];
+ if (GameInteractor_Should(VB_SET_BUTTON_ITEM_FROM_C_BUTTON_SLOT, true, i)) {
+ gSaveContext.equips.buttonItems[i] =
+ gSaveContext.inventory.items[gSaveContext.equips.cButtonSlots[i - 1]];
+ }
}
}
@@ -1674,8 +1676,10 @@ void Inventory_SwapAgeEquipment(void) {
((gSaveContext.equips.buttonItems[i] >= ITEM_WEIRD_EGG) &&
(gSaveContext.equips.buttonItems[i] <= ITEM_CLAIM_CHECK))) {
osSyncPrintf("Register_Item_Pt(%d)=%d\n", i, gSaveContext.equips.cButtonSlots[i - 1]);
- gSaveContext.equips.buttonItems[i] =
- gSaveContext.inventory.items[gSaveContext.equips.cButtonSlots[i - 1]];
+ if (GameInteractor_Should(VB_SET_BUTTON_ITEM_FROM_C_BUTTON_SLOT, true, i)) {
+ gSaveContext.equips.buttonItems[i] =
+ gSaveContext.inventory.items[gSaveContext.equips.cButtonSlots[i - 1]];
+ }
}
}
@@ -2703,13 +2707,6 @@ s32 Inventory_HasSpecificBottle(u8 bottleItem) {
}
}
-void byteSwapInventory() {
- gSaveContext.inventory.equipment = BE16SWAP(gSaveContext.inventory.equipment);
- gSaveContext.inventory.upgrades = BE32SWAP(gSaveContext.inventory.upgrades);
- gSaveContext.inventory.questItems = BE32SWAP(gSaveContext.inventory.questItems);
- gSaveContext.inventory.gsTokens = BE16SWAP(gSaveContext.inventory.gsTokens);
-}
-
void Inventory_UpdateBottleItem(PlayState* play, u8 item, u8 button) {
osSyncPrintf("item_no=%x, c_no=%x, Pt=%x Item_Register=%x\n", item, button,
gSaveContext.equips.cButtonSlots[button - 1],
@@ -2721,11 +2718,7 @@ void Inventory_UpdateBottleItem(PlayState* play, u8 item, u8 button) {
item = ITEM_MILK_HALF;
}
- if (CVarGetInteger(CVAR_ENHANCEMENT("RestoreRBAValues"),0)) {
- byteSwapInventory();
- gSaveContext.inventory.items[gSaveContext.equips.cButtonSlots[button - 1]] = item;
- byteSwapInventory();
- } else {
+ if (GameInteractor_Should(VB_UPDATE_BOTTLE_ITEM, true, button, item)) {
gSaveContext.inventory.items[gSaveContext.equips.cButtonSlots[button - 1]] = item;
}