Skip to content

Commit

Permalink
Fixed deku stick on B and horse swordless (HarbourMasters#995)
Browse files Browse the repository at this point in the history
  • Loading branch information
aMannus authored Aug 3, 2022
1 parent 7eba85c commit b89cc25
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions soh/src/code/z_parameter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1363,6 +1363,12 @@ void Inventory_SwapAgeEquipment(void) {
u16 temp;

if (LINK_AGE_IN_YEARS == YEARS_CHILD) {
// When becoming adult, remove swordless flag since we'll get master sword
// Only in rando to keep swordless link bugs in vanilla
if (gSaveContext.n64ddFlag) {
gSaveContext.infTable[29] &= ~1;
}

for (i = 0; i < ARRAY_COUNT(gSaveContext.equips.buttonItems); i++) {
if (i != 0) {
gSaveContext.childEquips.buttonItems[i] = gSaveContext.equips.buttonItems[i];
Expand Down Expand Up @@ -1423,6 +1429,12 @@ void Inventory_SwapAgeEquipment(void) {
gSaveContext.equips.equipment = gSaveContext.adultEquips.equipment;
}
} else {
// When becoming child, set swordless flag if player doesn't have kokiri sword
// Only in rando to keep swordless link bugs in vanilla
if (gSaveContext.n64ddFlag && (1 << 0 & gSaveContext.inventory.equipment) == 0) {
gSaveContext.infTable[29] |= 1;
}

for (i = 0; i < ARRAY_COUNT(gSaveContext.equips.buttonItems); i++) {
gSaveContext.adultEquips.buttonItems[i] = gSaveContext.equips.buttonItems[i];

Expand Down

0 comments on commit b89cc25

Please sign in to comment.