[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.
This commit is contained in:
Rosalie-A 2023-12-28 06:16:38 -05:00 committed by GitHub
parent 576c705106
commit 70eb2b58f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -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