mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-15 11:30:30 +00:00
Doc equips usage (inventory, current and player-specific constants) (#1142)
* Doc equips usage (inventory, current and player-specific constants) * Improve some comments * `currentSword`(`Item`) -> `currentSwordItemId` * Comments on the right in `D_801261F8` * Improve `sDebugSaveInventory.equipment` formatting with extra parentheses * Use constants for `sNewSaveInventory.equipment` * Run formatter * Make comments in z64save.h header a single line even if very long * `CHECK_OWNED_EQUIP_ALT` * One more use of `CHECK_OWNED_EQUIP` * `OWNED_EQUIP_FLAG` * `OWNED_EQUIP_FLAG_ALT` * Improve (?) giving sword by item id * "half-byte" -> "nibble" * Improve equips for setting kokiri sword * Improve (?) checking boots by item id * Improve (?) checking equips by item id * Fixup one spot assuming `EQUIP_TYPE_SWORD == 0` * Comments on the right in `sBootDListGroups`
This commit is contained in:
parent
72847660eb
commit
b9fded7b4e
27 changed files with 237 additions and 127 deletions
|
@ -1437,7 +1437,7 @@ void FileChoose_FadeOut(GameState* thisx) {
|
|||
*/
|
||||
void FileChoose_LoadGame(GameState* thisx) {
|
||||
FileChooseContext* this = (FileChooseContext*)thisx;
|
||||
u16 swordEquipMask;
|
||||
u16 swordEquipValue;
|
||||
s32 pad;
|
||||
|
||||
if (this->buttonIndex == FS_BTN_SELECT_FILE_1) {
|
||||
|
@ -1508,9 +1508,9 @@ void FileChoose_LoadGame(GameState* thisx) {
|
|||
(gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KNIFE)) {
|
||||
|
||||
gSaveContext.equips.buttonItems[0] = ITEM_NONE;
|
||||
swordEquipMask = gEquipMasks[EQUIP_SWORD] & gSaveContext.equips.equipment;
|
||||
gSaveContext.equips.equipment &= gEquipNegMasks[EQUIP_SWORD];
|
||||
gSaveContext.inventory.equipment ^= (gBitFlags[swordEquipMask - 1] << gEquipShifts[EQUIP_SWORD]);
|
||||
swordEquipValue = (gEquipMasks[EQUIP_TYPE_SWORD] & gSaveContext.equips.equipment) >> (EQUIP_TYPE_SWORD * 4);
|
||||
gSaveContext.equips.equipment &= gEquipNegMasks[EQUIP_TYPE_SWORD];
|
||||
gSaveContext.inventory.equipment ^= OWNED_EQUIP_FLAG(EQUIP_TYPE_SWORD, swordEquipValue - 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue