From 556cdad7eba75560ec57533e3d60e850fd1acf4c Mon Sep 17 00:00:00 2001 From: louist103 <35883445+louist103@users.noreply.github.com> Date: Sat, 21 Aug 2021 19:12:57 -0400 Subject: Big cleanup (#775) * Adult and child2 macros OK * ICHAIN cleanup * almost all overlay data * format.sh * func_8002FBAC NON_EQUIVALENT * PR fixes (MZXrules) * fix * change //@ bug to //! @bug * merge master and missed a //@bug * fix ruto * some more cleanup (#2) * more `! @bug` formatting cleanup * parenthesis cleanup * hex naviEnemyId * run formatter * replace `IS_NOT_` macros with `!IS_` * run formatter * run formatter * PR fixes (fig) * Missed something Co-authored-by: Dragorn421 --- src/code/audio_heap.c | 2 +- src/code/audio_seqplayer.c | 6 +++--- src/code/code_800430A0.c | 2 +- src/code/code_800F7260.c | 2 +- src/code/graph.c | 2 +- src/code/sys_math3d.c | 4 ++-- src/code/z_actor.c | 46 +++++++++++++++++++++++----------------------- src/code/z_bgcheck.c | 2 +- src/code/z_camera.c | 10 +++++----- src/code/z_debug.c | 4 ++-- src/code/z_demo.c | 4 ++-- src/code/z_elf_message.c | 6 +++--- src/code/z_en_item00.c | 2 +- src/code/z_horse.c | 2 +- src/code/z_onepointdemo.c | 2 +- src/code/z_play.c | 8 ++++---- src/code/z_player_lib.c | 16 ++++++++-------- src/code/z_scene_table.c | 6 +++--- 18 files changed, 63 insertions(+), 63 deletions(-) (limited to 'src/code') diff --git a/src/code/audio_heap.c b/src/code/audio_heap.c index 70bb62805..2899141f5 100644 --- a/src/code/audio_heap.c +++ b/src/code/audio_heap.c @@ -999,7 +999,7 @@ void* func_800E0540(s32 poolIdx, s32 id, u32 size) { gAudioContext.unk_2D60[sp18].poolIndex = poolIdx; gAudioContext.unk_2D60[sp18].id = id; gAudioContext.unk_2D60[sp18].size = size; - // @bug UB: missing return. "ret" is in v0 at this point, but doing an + //! @bug UB: missing return. "ret" is in v0 at this point, but doing an // explicit return uses an additional register. // return ret; } diff --git a/src/code/audio_seqplayer.c b/src/code/audio_seqplayer.c index 6b1ff361e..d7b09e5f5 100644 --- a/src/code/audio_seqplayer.c +++ b/src/code/audio_seqplayer.c @@ -1231,7 +1231,7 @@ void Audio_SequenceChannelProcessScript(SequenceChannel* channel) { case 0xE4: if (scriptState->value != -1) { data = (*channel->dynTable)[scriptState->value]; - // @bug: Missing a stack depth check here + //! @bug: Missing a stack depth check here scriptState->stack[scriptState->depth++] = scriptState->pc; offset = (u16)((data[0] << 8) + data[1]); scriptState->pc = player->seqData + offset; @@ -1254,7 +1254,7 @@ void Audio_SequenceChannelProcessScript(SequenceChannel* channel) { channel->panChannelWeight = data[-2]; channel->reverb = data[-1]; channel->reverbIndex = data[0]; - //@bug: Not marking reverb state as changed + //! @bug: Not marking reverb state as changed channel->changes.s.pan = true; break; case 0xE8: @@ -1267,7 +1267,7 @@ void Audio_SequenceChannelProcessScript(SequenceChannel* channel) { channel->panChannelWeight = Audio_M64ReadU8(scriptState); channel->reverb = Audio_M64ReadU8(scriptState); channel->reverbIndex = Audio_M64ReadU8(scriptState); - //@bug: Not marking reverb state as changed + //! @bug: Not marking reverb state as changed channel->changes.s.pan = true; break; case 0xEC: diff --git a/src/code/code_800430A0.c b/src/code/code_800430A0.c index 6b7623b79..742aa2ea0 100644 --- a/src/code/code_800430A0.c +++ b/src/code/code_800430A0.c @@ -29,7 +29,7 @@ void func_800430A0(CollisionContext* colCtx, s32 bgId, Actor* actor) { pos.y <= -BGCHECK_XYZ_ABSMAX || BGCHECK_XYZ_ABSMAX <= pos.z || pos.z <= -BGCHECK_XYZ_ABSMAX) { osSyncPrintf(VT_FGCOL(RED)); - // @bug file and line are not passed to osSyncPrintf + //! @bug file and line are not passed to osSyncPrintf // Position is not valid osSyncPrintf( "BGCheckCollection_typicalActorPos():位置が妥当ではありません。\npos (%f,%f,%f) file:%s line:%d\n", diff --git a/src/code/code_800F7260.c b/src/code/code_800F7260.c index db3180fb1..c924a726a 100644 --- a/src/code/code_800F7260.c +++ b/src/code/code_800F7260.c @@ -227,7 +227,7 @@ void func_800F7680(void) { if (gSoundBanks[phi_s5][phi_a1].unk_28 == sp50->sfxId) { sp55 = D_80130594[D_801333CC][phi_s5]; } else { - //!@bug possibly uninitialized sp43 ? confirm when matching + //! @bug possibly uninitialized sp43 ? confirm when matching if (sp55 == 0) { phi_s1 = phi_a1; flag1 = gSoundBanks[phi_s5][phi_a1].unk_28 & 0xFFFF; diff --git a/src/code/graph.c b/src/code/graph.c index 2ad106782..ea477077e 100644 --- a/src/code/graph.c +++ b/src/code/graph.c @@ -322,7 +322,7 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) { GfxPool* pool = &gGfxPools[gfxCtx->gfxPoolIdx & 1]; if (pool->headMagic != GFXPOOL_HEAD_MAGIC) { - // @bug (?) : devs might've forgotten "problem = true;" + //! @bug (?) : devs might've forgotten "problem = true;" osSyncPrintf("%c", 7); // Dynamic area head is destroyed osSyncPrintf(VT_COL(RED, WHITE) "ダイナミック領域先頭が破壊されています\n" VT_RST); diff --git a/src/code/sys_math3d.c b/src/code/sys_math3d.c index 620ddee94..b3509751a 100644 --- a/src/code/sys_math3d.c +++ b/src/code/sys_math3d.c @@ -626,7 +626,7 @@ s32 Math3D_PointRelativeToCubeVertices(Vec3f* point, Vec3f* min, Vec3f* max) { ret |= 0x10; } - // @BUG: The next 2 conditions are the same check. + //! @bug: The next 2 conditions are the same check. if ((-min->x - min->y + max->z) < (-point->x - point->y + point->z)) { ret |= 0x20; } @@ -726,7 +726,7 @@ s32 Math3D_LineVsCube(Vec3f* min, Vec3f* max, Vec3f* a, Vec3f* b) { triVtx1.y = min->y; triVtx1.z = max->z; triVtx2.x = max->x; - // @Bug trVtx1.y should be triVtx2.y, prevents a tri on the cube from being checked. + //! @bug trVtx1.y should be triVtx2.y, prevents a tri on the cube from being checked. triVtx1.y = min->y; triVtx2.z = max->z; if (Math3D_TriLineIntersect(&triVtx0, &triVtx1, &triVtx2, 0.0f, 0.0f, 1.0f, -max->z, a, b, &intersectPoint, 0)) { diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 4a8c2b33f..20282d003 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -1819,7 +1819,7 @@ void func_8002FBAC(GlobalContext* globalCtx) { spF0 = gSaveContext.respawn[RESPAWN_MODE_TOP].data; if (spF0 != 0) { - f32 spD8 = (LINK_IS_ADULT) ? 80.0f : 60.0f; + f32 spD8 = LINK_IS_ADULT ? 80.0f : 60.0f; f32 spD4 = 1.0f; s32 spD0 = 0xFF; s32 spCC = spF0 - 40; @@ -4239,7 +4239,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 1: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x9)) { if (Flags_GetInfTable(0x10)) { retTextId = 0x1046; @@ -4286,7 +4286,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 2: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x9)) { retTextId = 0x1042; } else { @@ -4303,7 +4303,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 3: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x9)) { retTextId = 0x1043; } else { @@ -4322,7 +4322,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 4: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x9)) { retTextId = 0x1042; } else { @@ -4339,7 +4339,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 5: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x9)) { retTextId = 0x1044; } else if (Flags_GetInfTable(0x22)) { @@ -4356,7 +4356,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 6: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x9)) { retTextId = 0x1042; } else if (Flags_GetInfTable(0x24)) { @@ -4373,7 +4373,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 7: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x9)) { retTextId = 0x1043; } else if (Flags_GetInfTable(0x26)) { @@ -4390,7 +4390,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 8: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x9)) { retTextId = 0x1043; } else if (Flags_GetInfTable(0x28)) { @@ -4409,7 +4409,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 9: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x9)) { retTextId = 0x1049; } else { @@ -4424,7 +4424,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 10: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x9)) { retTextId = 0x104A; } else { @@ -4441,7 +4441,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 11: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x9)) { retTextId = 0x104B; } else { @@ -4456,7 +4456,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 12: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x9)) { retTextId = 0x104C; } else { @@ -4471,7 +4471,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 13: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x9)) { retTextId = 0x104D; } else { @@ -4653,7 +4653,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { retTextId = 0x5002; break; case 38: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x25)) { retTextId = 0x3027; } else if (Flags_GetEventChkInf(0x23)) { @@ -4672,7 +4672,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 39: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x25)) { retTextId = 0x3027; } else if (Flags_GetEventChkInf(0x23)) { @@ -4689,7 +4689,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 40: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x25)) { retTextId = 0x3027; } else if (Flags_GetEventChkInf(0x23)) { @@ -4708,7 +4708,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 41: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x25)) { retTextId = 0x3027; } else if (Flags_GetInfTable(0xF0)) { @@ -4725,7 +4725,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 42: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x25)) { retTextId = 0x3027; } else if (Flags_GetInfTable(0xF4)) { @@ -4742,7 +4742,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 43: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x25)) { retTextId = 0x3027; } else if (Flags_GetInfTable(0xF8)) { @@ -4834,7 +4834,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 55: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x37)) { retTextId = 0x402B; } else if (Flags_GetEventChkInf(0x31)) { @@ -4896,7 +4896,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 72: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x14)) { retTextId = 0x2040; } else if (Flags_GetInfTable(0x94)) { @@ -4906,7 +4906,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } } else { if (!Flags_GetEventChkInf(0x18)) { - if (gSaveContext.nightFlag != 0) { + if (!IS_DAY) { retTextId = 0x204E; } else if (Flags_GetInfTable(0x9A)) { retTextId = 0x2031; diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c index 32c951d12..c8be7361b 100644 --- a/src/code/z_bgcheck.c +++ b/src/code/z_bgcheck.c @@ -274,7 +274,7 @@ void CollisionPoly_GetVerticesByBgId(CollisionPoly* poly, s32 bgId, CollisionCon osSyncPrintf(VT_RST); if (dest != NULL) { - // @bug: dest[2] x and y are not set to 0 + //! @bug: dest[2] x and y are not set to 0 dest[0].x = dest[0].y = dest[0].z = dest[1].x = dest[1].y = dest[1].z = dest[2].z = 0.0f; } } else { diff --git a/src/code/z_camera.c b/src/code/z_camera.c index 2bca956d5..5f643a09c 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -2143,7 +2143,7 @@ s32 Camera_Parallel3(Camera* camera) { if (val & 2) { camera->unk_14C |= 0x10; } - // @bug doesn't return + //! @bug doesn't return } s32 Camera_Parallel4(Camera* camera) { @@ -6106,7 +6106,7 @@ s32 Camera_Demo7(Camera* camera) { camera->unk_14C |= 0x1000; camera->animState++; } - // @bug doesn't return + //! @bug doesn't return } s32 Camera_Demo8(Camera* camera) { @@ -7153,7 +7153,7 @@ s32 Camera_CheckWater(Camera* camera) { } func_800F6828(0); } - // @BUG: doesn't always return a value, but sometimes does. + //! @bug: doesn't always return a value, but sometimes does. } /** @@ -7723,7 +7723,7 @@ s16 Camera_ChangeSettingFlags(Camera* camera, s16 setting, s16 flags) { return -2; } } - if (((setting == CAM_SET_SPOT05A) || (setting == CAM_SET_SPOT05B)) && (LINK_IS_ADULT) && + if (((setting == CAM_SET_SPOT05A) || (setting == CAM_SET_SPOT05B)) && LINK_IS_ADULT && (camera->globalCtx->sceneNum == SCENE_SPOT05)) { camera->unk_14A |= 0x10; return -5; @@ -7799,7 +7799,7 @@ s32 Camera_ChangeDataIdx(Camera* camera, s32 camDataIdx) { camera->unk_14A |= 4; Camera_CopyModeValuesToPREG(camera, camera->mode); } else if (settingChangeSuccessful < -1) { - // @bug: This is likely checking the wrong value. The actual return of Camera_ChangeSettingFlags or + //! @bug: This is likely checking the wrong value. The actual return of Camera_ChangeSettingFlags or // camDataIdx would make more sense. osSyncPrintf(VT_COL(RED, WHITE) "camera: error: illegal camera ID (%d) !! (%d|%d|%d)\n" VT_RST, camDataIdx, camera->thisIdx, 0x32, newCameraSetting); diff --git a/src/code/z_debug.c b/src/code/z_debug.c index 6cb76f846..21b0fee3e 100644 --- a/src/code/z_debug.c +++ b/src/code/z_debug.c @@ -151,13 +151,13 @@ void func_8006390C(Input* input) { gGameInfo->dpadLast = dpad; } - increment = (CHECK_BTN_ANY(dpad, BTN_DRIGHT)) + increment = CHECK_BTN_ANY(dpad, BTN_DRIGHT) ? (CHECK_BTN_ALL(input->cur.button, BTN_A | BTN_B) ? 1000 : CHECK_BTN_ALL(input->cur.button, BTN_A) ? 100 : CHECK_BTN_ALL(input->cur.button, BTN_B) ? 10 : 1) - : (CHECK_BTN_ANY(dpad, BTN_DLEFT)) + : CHECK_BTN_ANY(dpad, BTN_DLEFT) ? (CHECK_BTN_ALL(input->cur.button, BTN_A | BTN_B) ? -1000 : CHECK_BTN_ALL(input->cur.button, BTN_A) diff --git a/src/code/z_demo.c b/src/code/z_demo.c index a8d5b318b..5b25120bd 100644 --- a/src/code/z_demo.c +++ b/src/code/z_demo.c @@ -367,7 +367,7 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* gSaveContext.unk_1422 = 1; break; case 34: - if (gSaveContext.nightFlag == 0) { + if (IS_DAY) { gSaveContext.dayTime -= D_8011FB40; } else { gSaveContext.dayTime -= D_8011FB40 * 2; @@ -523,7 +523,7 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt globalCtx->fadeTransition = 11; } else { if (gSaveContext.sceneSetupIndex < 4) { - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { globalCtx->linkAgeOnLoad = 0; } else { globalCtx->linkAgeOnLoad = 1; diff --git a/src/code/z_elf_message.c b/src/code/z_elf_message.c index 481732170..eb81dec6d 100644 --- a/src/code/z_elf_message.c +++ b/src/code/z_elf_message.c @@ -36,10 +36,10 @@ u32 ElfMessage_CheckCondition(ElfMessage* msg) { gSaveContext.inventory.equipment) != 0); case 0x20: return ((msg->byte0 & 1) == 1) == - ((CHECK_QUEST_ITEM(msg->byte3 - ITEM_SONG_MINUET + QUEST_SONG_MINUET)) != 0); + (CHECK_QUEST_ITEM(msg->byte3 - ITEM_SONG_MINUET + QUEST_SONG_MINUET) != 0); case 0x30: return ((msg->byte0 & 1) == 1) == - ((CHECK_QUEST_ITEM(msg->byte3 - ITEM_MEDALLION_FOREST + QUEST_MEDALLION_FOREST)) != 0); + (CHECK_QUEST_ITEM(msg->byte3 - ITEM_MEDALLION_FOREST + QUEST_MEDALLION_FOREST) != 0); case 0x40: return ((msg->byte0 & 1) == 1) == (((void)0, gSaveContext.magicAcquired) != 0); } @@ -141,7 +141,7 @@ u16 ElfMessage_GetSariaText(GlobalContext* globalCtx) { Player* player = PLAYER; ElfMessage* msgs; - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Actor_FindNearby(globalCtx, &player->actor, ACTOR_EN_SA, 4, 800.0f) == NULL) { msgs = sChildSariaMsgs; } else { diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index dbc0b1f98..6393c2f43 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -1275,7 +1275,7 @@ void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3 params = 0xA * 0x10; dropTableIndex = 0x0; dropId = ITEM00_MAGIC_SMALL; - } else if (LINK_IS_CHILD && (AMMO(ITEM_SLINGSHOT) < 6)) { + } else if (!LINK_IS_ADULT && (AMMO(ITEM_SLINGSHOT) < 6)) { params = 0xA * 0x10; dropTableIndex = 0x0; dropId = ITEM00_SEEDS; diff --git a/src/code/z_horse.c b/src/code/z_horse.c index 12f69871c..1ba9e37dc 100644 --- a/src/code/z_horse.c +++ b/src/code/z_horse.c @@ -112,7 +112,7 @@ void func_8006D0EC(GlobalContext* globalCtx, Player* player) { } } } else if (!Flags_GetEventChkInf(0x18)) { - if ((DREG(1) == 0) && (globalCtx->sceneNum == SCENE_SOUKO) && (gSaveContext.nightFlag != 0)) { + if ((DREG(1) == 0) && (globalCtx->sceneNum == SCENE_SOUKO) && !IS_DAY) { Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 0.0f, 0.0f, -60.0f, 0, 0x7360, 0, 1); } } diff --git a/src/code/z_onepointdemo.c b/src/code/z_onepointdemo.c index d3f995642..53626f510 100644 --- a/src/code/z_onepointdemo.c +++ b/src/code/z_onepointdemo.c @@ -964,7 +964,7 @@ s32 OnePointCutscene_SetInfo(GlobalContext* globalCtx, s16 camIdx, s16 csId, Act break; case 9908: if (func_800C0CB8(globalCtx)) { - D_801231B4[0].eyeTargetInit.z = D_801231B4[1].eyeTargetInit.z = LINK_IS_CHILD ? 100.0f : 120.0f; + D_801231B4[0].eyeTargetInit.z = D_801231B4[1].eyeTargetInit.z = !LINK_IS_ADULT ? 100.0f : 120.0f; if (player->stateFlags1 & 0x08000000) { D_801231B4[2].atTargetInit.z = 0.0f; diff --git a/src/code/z_play.c b/src/code/z_play.c index 116c3becf..f1fffbd1b 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -261,18 +261,18 @@ void Gameplay_Init(GameState* thisx) { gSaveContext.nayrusLoveTimer = 0; func_800876C8(globalCtx); gSaveContext.sceneSetupIndex = (gSaveContext.cutsceneIndex & 0xF) + 4; - } else if (LINK_IS_CHILD && gSaveContext.nightFlag == 0) { + } else if (!LINK_IS_ADULT && IS_DAY) { gSaveContext.sceneSetupIndex = 0; - } else if (LINK_IS_CHILD && gSaveContext.nightFlag != 0) { + } else if (!LINK_IS_ADULT && !IS_DAY) { gSaveContext.sceneSetupIndex = 1; - } else if (LINK_IS_ADULT && gSaveContext.nightFlag == 0) { + } else if (LINK_IS_ADULT && IS_DAY) { gSaveContext.sceneSetupIndex = 2; } else { gSaveContext.sceneSetupIndex = 3; } tempSetupIndex = gSaveContext.sceneSetupIndex; - if ((gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_SPOT00) && LINK_IS_CHILD && + if ((gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_SPOT00) && !LINK_IS_ADULT && gSaveContext.sceneSetupIndex < 4) { if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && CHECK_QUEST_ITEM(QUEST_GORON_RUBY) && CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE)) { diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index 0b745243f..8540caeb8 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -262,7 +262,7 @@ void Player_SetBootData(GlobalContext* globalCtx, Player* this) { currentBoots = this->currentBoots; if (currentBoots == PLAYER_BOOTS_NORMAL) { - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { currentBoots = PLAYER_BOOTS_NORMAL_CHILD; } } else if (currentBoots == PLAYER_BOOTS_IRON) { @@ -314,7 +314,7 @@ s32 func_8008E9C4(Player* this) { } s32 Player_IsChildWithHylianShield(Player* this) { - return LINK_IS_CHILD && (this->currentShield == PLAYER_SHIELD_HYLIAN); + return gSaveContext.linkAge != 0 && (this->currentShield == PLAYER_SHIELD_HYLIAN); } s32 Player_ActionToModelGroup(Player* this, s32 actionParam) { @@ -825,7 +825,7 @@ s32 func_8008FCC8(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p D_80160018 = this->rightHandType; D_80160000 = &this->swordInfo[2].base; - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (!(this->skelAnime.moveFlags & 4) || (this->skelAnime.moveFlags & 1)) { pos->x *= 0.64f; pos->z *= 0.64f; @@ -917,11 +917,11 @@ s32 func_80090014(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p if ((this->sheathType == 18) || (this->sheathType == 19)) { dLists += this->currentShield * 4; - if ((LINK_IS_CHILD) && (this->currentShield < PLAYER_SHIELD_HYLIAN) && + if (!LINK_IS_ADULT && (this->currentShield < PLAYER_SHIELD_HYLIAN) && (gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KOKIRI)) { dLists += 16; } - } else if ((LINK_IS_CHILD) && ((this->sheathType == 16) || (this->sheathType == 17)) && + } else if (!LINK_IS_ADULT && ((this->sheathType == 16) || (this->sheathType == 17)) && (gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KOKIRI)) { dLists = D_80125D68; } @@ -1298,7 +1298,7 @@ void func_80090D20(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* Matrix_Scale(1.0f, this->unk_858, 1.0f, MTXMODE_APPLY); - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { Matrix_RotateZ(this->unk_858 * -0.2f, MTXMODE_APPLY); } @@ -1404,7 +1404,7 @@ s32 func_80091880(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p s32 dListOffset = 0; Gfx** dLists; - if ((modelGroup == 2) && LINK_IS_CHILD && (ptr[1] == 2)) { + if ((modelGroup == 2) && !LINK_IS_ADULT && (ptr[1] == 2)) { modelGroup = 1; } @@ -1551,7 +1551,7 @@ void func_8009214C(GlobalContext* globalCtx, u8* segment, SkelAnime* skelAnime, gSegments[4] = VIRTUAL_TO_PHYSICAL(segment + 0x3800); gSegments[6] = VIRTUAL_TO_PHYSICAL(segment + 0x8800); - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (shield == PLAYER_SHIELD_DEKU) { srcTable = D_040020D0; } else { diff --git a/src/code/z_scene_table.c b/src/code/z_scene_table.c index 09d502f37..a33237aec 100644 --- a/src/code/z_scene_table.c +++ b/src/code/z_scene_table.c @@ -926,14 +926,14 @@ Gfx sDefaultDisplayList[] = { void func_800994A0(GlobalContext* globalCtx) { s16 computedEntranceIndex; - if (gSaveContext.nightFlag != 0) { - if (LINK_IS_CHILD) { + if (!IS_DAY) { + if (!LINK_IS_ADULT) { computedEntranceIndex = globalCtx->nextEntranceIndex + 1; } else { computedEntranceIndex = globalCtx->nextEntranceIndex + 3; } } else { - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { computedEntranceIndex = globalCtx->nextEntranceIndex; } else { computedEntranceIndex = globalCtx->nextEntranceIndex + 2; -- cgit v1.2.3