From a39a9a58e98d58f6caf455c1489cc367d878bf67 Mon Sep 17 00:00:00 2001 From: Jacob Erly Date: Fri, 31 May 2024 17:13:42 -0500 Subject: [PATCH] Adds sanity checks for bottle duping over items and prevents the issue causing Big Goron to not give the player the Keg License. (#605) * Update Infinite.cpp Adds sanity checks for bottle duping and prevents the issue causing Big Goron to not give the player the Keg License. * Update Infinite.cpp Formatting. * Update Infinite.cpp * Update Infinite.cpp More formatting trying to work around this Clang stuff while working from Github. --- mm/2s2h/Enhancements/Cheats/Infinite.cpp | 34 +++++++++++++++++++----- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/mm/2s2h/Enhancements/Cheats/Infinite.cpp b/mm/2s2h/Enhancements/Cheats/Infinite.cpp index 182bd8338..ff542feab 100644 --- a/mm/2s2h/Enhancements/Cheats/Infinite.cpp +++ b/mm/2s2h/Enhancements/Cheats/Infinite.cpp @@ -26,13 +26,33 @@ void RegisterInfiniteCheats() { } if (CVarGetInteger("gCheats.InfiniteConsumables", 0)) { - AMMO(ITEM_BOW) = CUR_CAPACITY(UPG_QUIVER); - AMMO(ITEM_BOMB) = CUR_CAPACITY(UPG_BOMB_BAG); - AMMO(ITEM_BOMBCHU) = CUR_CAPACITY(UPG_BOMB_BAG); - AMMO(ITEM_DEKU_STICK) = CUR_CAPACITY(UPG_DEKU_STICKS); - AMMO(ITEM_DEKU_NUT) = CUR_CAPACITY(UPG_DEKU_NUTS); - AMMO(ITEM_MAGIC_BEANS) = 20; - AMMO(ITEM_POWDER_KEG) = 1; + if (INV_CONTENT(ITEM_BOW) == ITEM_BOW) { + AMMO(ITEM_BOW) = CUR_CAPACITY(UPG_QUIVER); + } + + if (INV_CONTENT(ITEM_BOMB) == ITEM_BOMB) { + AMMO(ITEM_BOMB) = CUR_CAPACITY(UPG_BOMB_BAG); + } + + if (INV_CONTENT(ITEM_BOMBCHU) == ITEM_BOMBCHU) { + AMMO(ITEM_BOMBCHU) = CUR_CAPACITY(UPG_BOMB_BAG); + } + + if (INV_CONTENT(ITEM_DEKU_STICK) == ITEM_DEKU_STICK) { + AMMO(ITEM_DEKU_STICK) = CUR_CAPACITY(UPG_DEKU_STICKS); + } + + if (INV_CONTENT(ITEM_DEKU_NUT) == ITEM_DEKU_NUT) { + AMMO(ITEM_DEKU_NUT) = CUR_CAPACITY(UPG_DEKU_NUTS); + } + + if (INV_CONTENT(ITEM_MAGIC_BEANS) == ITEM_MAGIC_BEANS) { + AMMO(ITEM_MAGIC_BEANS) = 20; + } + + if (INV_CONTENT(ITEM_POWDER_KEG) == ITEM_POWDER_KEG) { + AMMO(ITEM_POWDER_KEG) = 1; + } } }); }