From 7ed3ab500bf601ec05c4bb13f67c0748357b6833 Mon Sep 17 00:00:00 2001 From: gymnast86 Date: Tue, 3 Oct 2023 03:58:09 -0700 Subject: [PATCH] fix goddess chests --- patches/stagepatchhandler.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/patches/stagepatchhandler.py b/patches/stagepatchhandler.py index d92c5679..f9be69c1 100644 --- a/patches/stagepatchhandler.py +++ b/patches/stagepatchhandler.py @@ -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