Skip to content

Commit 5a4e8ae

Browse files
Rosalie-AJouramie
authored andcommitted
[TLOZ] Fix bug with item drops in non-expanded item pool (ArchipelagoMW#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.
1 parent 1ac1b2f commit 5a4e8ae

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

worlds/tloz/__init__.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -200,15 +200,17 @@ def apply_base_patch(self, rom):
200200
for i in range(0, 0x7F):
201201
item = rom_data[first_quest_dungeon_items_early + i]
202202
if item & 0b00100000:
203-
rom_data[first_quest_dungeon_items_early + i] = item & 0b11011111
204-
rom_data[first_quest_dungeon_items_early + i] = item | 0b01000000
203+
item = item & 0b11011111
204+
item = item | 0b01000000
205+
rom_data[first_quest_dungeon_items_early + i] = item
205206
if item & 0b00011111 == 0b00000011: # Change all Item 03s to Item 3F, the proper "nothing"
206207
rom_data[first_quest_dungeon_items_early + i] = item | 0b00111111
207208

208209
item = rom_data[first_quest_dungeon_items_late + i]
209210
if item & 0b00100000:
210-
rom_data[first_quest_dungeon_items_late + i] = item & 0b11011111
211-
rom_data[first_quest_dungeon_items_late + i] = item | 0b01000000
211+
item = item & 0b11011111
212+
item = item | 0b01000000
213+
rom_data[first_quest_dungeon_items_late + i] = item
212214
if item & 0b00011111 == 0b00000011:
213215
rom_data[first_quest_dungeon_items_late + i] = item | 0b00111111
214216
return rom_data

0 commit comments

Comments
 (0)