diff options
| author | Amber Burton <parchmentwolf@gmail.com> | 2026-07-12 11:09:06 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-12 15:09:06 +0000 |
| commit | 2b423c36aa0708a9e042b1afe8f252a6cf91c556 (patch) | |
| tree | 38eefbd3d7530bbd1a1940aab83a350d9a32d82a /soh/src/code | |
| parent | 1003c462a886e6046071865d2091c6e742a2f4b7 (diff) | |
GIM Restoration (#6865)
All edge cases for bottle combinations and replacement/filling mirrors the real game, as well we produce the compass text, and does not render the item exactly as the original game does. (I would have preferred rendering the item since its only cosmetic but I couldn't find a way to do it).
This also swaps the table redirect stuff for using the direct item id's which is a lot more clear and does not substitute anything for 'good enough' and covers all the edge case ids that have been documented.
This is purely a cosmetic change to present the visual of the item without affecting the cutscene making any tricks for GIM still work and just looks more polished.
This supplies effects of ALL game versions (including MZX build) as well as providing text table.
To note: we still can crash with GIM even when returning item None EVEN at least with returning Kokiri Tunic (I can't really figure out why) and there are a few items in the table that use extra data that I don't know how to implement here just yet but the info is in the docs under "Variable".
In the case of disabling the gim restoration, the game would still crash. This change adds a text id protection to prevent crashing, as well prevents invalid items from crashing directly, and also makes it so the game will no longer crash when having GIM disabled in the menu.
Co-authored-by: serprex <159546+serprex@users.noreply.github.com>
Diffstat (limited to 'soh/src/code')
| -rw-r--r-- | soh/src/code/z_message_PAL.c | 4 | ||||
| -rw-r--r-- | soh/src/code/z_parameter.c | 9 |
2 files changed, 9 insertions, 4 deletions
diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index b049f7c2a..60cbef0bd 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -2736,7 +2736,9 @@ void Message_OpenText(PlayState* play, u16 textId) { textId = 0xB; // Traded Giant's Knife for Biggoron Sword } else if (!IS_RANDO && (msgCtx->textId == 0xB4 && (Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_CURSED_MAN_IN_SKULL_HOUSE)))) { - textId = 0xB5; // Destroyed Gold Skulltula + textId = 0xB5; // Destroyed Gold Skulltula + } else if (textId == 0x0) { // Invalid text probably from GIM or SRM + textId = 1; } // Ocarina Staff + Dialog if (textId == 0x4077 || // Pierre? diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index a807a42b1..6f53e192b 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -2383,7 +2383,7 @@ u8 Item_Give(PlayState* play, u8 item) { } gSaveContext.inventory.items[temp + i] = item; - break; + return Return_Item(item, MOD_NONE, ITEM_NONE); } } } else { @@ -2393,11 +2393,14 @@ u8 Item_Give(PlayState* play, u8 item) { for (i = 0; i < 4; i++) { if (gSaveContext.inventory.items[temp + i] == ITEM_NONE) { gSaveContext.inventory.items[temp + i] = item; - break; + return Return_Item(item, MOD_NONE, ITEM_NONE); } } } - return Return_Item(item, MOD_NONE, ITEM_NONE); + + if (IS_RANDO) { + return Return_Item(item, MOD_NONE, ITEM_NONE); + } } else if ((item >= ITEM_WEIRD_EGG) && (item <= ITEM_CLAIM_CHECK)) { if (GameInteractor_Should(VB_POACHERS_SAW_SET_DEKU_NUT_UPGRADE_FLAG, item == ITEM_SAW)) { Flags_SetItemGetInf(ITEMGETINF_OBTAINED_NUT_UPGRADE_FROM_STAGE); |
