mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-13 01:57:18 -07:00
Switch age fix (#2676)
* specific scenarios for switch age button, non rando * Working fix for vanilla swordless change age * Fix now works for randomiser * Fixed room load on change age transition * Removed potentially unnecessary function call Need to investigate this more, maybe wait for more room documentation. * Suggested Edits Moves setting cvar back into mods.cpp and makes clear the condition expected for the no sword flag
This commit is contained in:
parent
0f6147f41d
commit
1fa31410c2
2 changed files with 36 additions and 12 deletions
|
@ -1411,17 +1411,18 @@ 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];
|
||||
} else {
|
||||
gSaveContext.childEquips.buttonItems[i] = ITEM_SWORD_KOKIRI;
|
||||
if (CVarGetInteger("gSwitchAge", 0) &&
|
||||
(gSaveContext.infTable[29] & 1)) {
|
||||
gSaveContext.childEquips.buttonItems[i] = ITEM_NONE;
|
||||
} else {
|
||||
gSaveContext.childEquips.buttonItems[i] = ITEM_SWORD_KOKIRI;
|
||||
}
|
||||
}
|
||||
|
||||
if (i != 0) {
|
||||
|
@ -1429,6 +1430,12 @@ void Inventory_SwapAgeEquipment(void) {
|
|||
}
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
gSaveContext.childEquips.equipment = gSaveContext.equips.equipment;
|
||||
|
||||
if (gSaveContext.adultEquips.buttonItems[0] == ITEM_NONE) {
|
||||
|
@ -1493,7 +1500,8 @@ void Inventory_SwapAgeEquipment(void) {
|
|||
|
||||
gSaveContext.adultEquips.equipment = gSaveContext.equips.equipment;
|
||||
|
||||
if (gSaveContext.childEquips.buttonItems[0] != ITEM_NONE) {
|
||||
if (gSaveContext.childEquips.buttonItems[0] != ITEM_NONE ||
|
||||
CVarGetInteger("gSwitchAge", 0)) {
|
||||
for (i = 0; i < ARRAY_COUNT(gSaveContext.equips.buttonItems); i++) {
|
||||
gSaveContext.equips.buttonItems[i] = gSaveContext.childEquips.buttonItems[i];
|
||||
|
||||
|
@ -1533,6 +1541,16 @@ void Inventory_SwapAgeEquipment(void) {
|
|||
}
|
||||
gSaveContext.equips.equipment = 0x1111;
|
||||
}
|
||||
|
||||
if (CVarGetInteger("gSwitchAge", 0) &&
|
||||
(gSaveContext.equips.buttonItems[0] == ITEM_NONE)) {
|
||||
gSaveContext.infTable[29] |= 1;
|
||||
if (gSaveContext.childEquips.equipment == 0) {
|
||||
// force equip kokiri tunic and boots in scenario gSaveContext.childEquips.equipment is uninitialized
|
||||
gSaveContext.equips.equipment &= 0xFFF0;
|
||||
gSaveContext.equips.equipment |= 0x1100;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
temp = gEquipMasks[EQUIP_SHIELD] & gSaveContext.equips.equipment;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue