Skip to content

Commit

Permalink
Merge pull request #63 from gymnast86/fix-goddess-chests
Browse files Browse the repository at this point in the history
Fix goddess chests
  • Loading branch information
gymnast86 authored Oct 3, 2023
2 parents f84946f + 7ed3ab5 commit 794f87a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions patches/stagepatchhandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ def patch_tbox(bzs: dict, itemid: int, id_str: str):
return

original_itemid = tbox["anglez"] & 0x1FF

# Goddess Chests (subtype 0x03) expect the signed negative number of
# the item id for the item they have (for some reason)
# 9 bits means 2^9 - 1 = 511
if tbox_subtypes[original_itemid] == 0x03:
itemid = 511 - itemid

# patches item
tbox["anglez"] = mask_shift_set(tbox["anglez"], 0x1FF, 0, itemid)
# patches chest type
Expand Down

0 comments on commit 794f87a

Please sign in to comment.