summaryrefslogtreecommitdiff
path: root/soh/src/code
diff options
context:
space:
mode:
Diffstat (limited to 'soh/src/code')
-rw-r--r--soh/src/code/z_parameter.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c
index 75c85e3e4..1ff5b35b2 100644
--- a/soh/src/code/z_parameter.c
+++ b/soh/src/code/z_parameter.c
@@ -2782,6 +2782,13 @@ 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],
@@ -2793,7 +2800,14 @@ void Inventory_UpdateBottleItem(PlayState* play, u8 item, u8 button) {
item = ITEM_MILK_HALF;
}
- gSaveContext.inventory.items[gSaveContext.equips.cButtonSlots[button - 1]] = item;
+ if (CVarGetInteger("gRestoreRBAValues",0)) {
+ byteSwapInventory();
+ gSaveContext.inventory.items[gSaveContext.equips.cButtonSlots[button - 1]] = item;
+ byteSwapInventory();
+ } else {
+ gSaveContext.inventory.items[gSaveContext.equips.cButtonSlots[button - 1]] = item;
+ }
+
gSaveContext.equips.buttonItems[button] = item;
Interface_LoadItemIcon1(play, button);