Fixed deku stick on B and horse swordless (#995)

This commit is contained in:
aMannus 2022-08-03 05:46:39 +02:00 committed by GitHub
parent 7eba85c3b4
commit b89cc25df3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1363,6 +1363,12 @@ void Inventory_SwapAgeEquipment(void) {
u16 temp; u16 temp;
if (LINK_AGE_IN_YEARS == YEARS_CHILD) { 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++) { for (i = 0; i < ARRAY_COUNT(gSaveContext.equips.buttonItems); i++) {
if (i != 0) { if (i != 0) {
gSaveContext.childEquips.buttonItems[i] = gSaveContext.equips.buttonItems[i]; gSaveContext.childEquips.buttonItems[i] = gSaveContext.equips.buttonItems[i];
@ -1423,6 +1429,12 @@ void Inventory_SwapAgeEquipment(void) {
gSaveContext.equips.equipment = gSaveContext.adultEquips.equipment; gSaveContext.equips.equipment = gSaveContext.adultEquips.equipment;
} }
} else { } 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++) { for (i = 0; i < ARRAY_COUNT(gSaveContext.equips.buttonItems); i++) {
gSaveContext.adultEquips.buttonItems[i] = gSaveContext.equips.buttonItems[i]; gSaveContext.adultEquips.buttonItems[i] = gSaveContext.equips.buttonItems[i];