From 70eb2b58f55c277433d4f453ea2f5daa51462fbf Mon Sep 17 00:00:00 2001 From: Rosalie-A <61372066+Rosalie-A@users.noreply.github.com> Date: Thu, 28 Dec 2023 06:16:38 -0500 Subject: [PATCH] [TLOZ] Fix bug with item drops in non-expanded item pool (#2623) There was a bug in non-expanded item pool where due to the base patch changes to accommodate more items in dungeons, some items were transformed into glitch items that removed bombs (this also happened in expanded item pool, but the item placement would overwrite the results of this bug so it didn't appear as frequently). Being a Zelda game, losing bombs is bad. This PR fixes the base patch process to avoid this bug, by properly carrying the value of a variable through a procedure. --- worlds/tloz/__init__.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/worlds/tloz/__init__.py b/worlds/tloz/__init__.py index 20ab003e..6e8927c4 100644 --- a/worlds/tloz/__init__.py +++ b/worlds/tloz/__init__.py @@ -200,15 +200,17 @@ class TLoZWorld(World): for i in range(0, 0x7F): item = rom_data[first_quest_dungeon_items_early + i] if item & 0b00100000: - rom_data[first_quest_dungeon_items_early + i] = item & 0b11011111 - rom_data[first_quest_dungeon_items_early + i] = item | 0b01000000 + item = item & 0b11011111 + item = item | 0b01000000 + rom_data[first_quest_dungeon_items_early + i] = item if item & 0b00011111 == 0b00000011: # Change all Item 03s to Item 3F, the proper "nothing" rom_data[first_quest_dungeon_items_early + i] = item | 0b00111111 item = rom_data[first_quest_dungeon_items_late + i] if item & 0b00100000: - rom_data[first_quest_dungeon_items_late + i] = item & 0b11011111 - rom_data[first_quest_dungeon_items_late + i] = item | 0b01000000 + item = item & 0b11011111 + item = item | 0b01000000 + rom_data[first_quest_dungeon_items_late + i] = item if item & 0b00011111 == 0b00000011: rom_data[first_quest_dungeon_items_late + i] = item | 0b00111111 return rom_data