diff options
| author | Pepe20129 <72659707+Pepe20129@users.noreply.github.com> | 2023-11-26 17:54:54 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-26 11:54:54 -0500 |
| commit | 5b81964ea5c0c1087f20b4f8da5a5605501784e8 (patch) | |
| tree | 738a8a70c4df16ab3c29b71a7117642a7cf4ccfe /soh/src/code | |
| parent | d0d1d9c4879c4f95622a9573b171a6bf13f55597 (diff) | |
Bring over some player documentation from decomp (#3380)
* Document static variables
* Document enums and structs
* Document some functions
* Document more functions
* actionParam to itemAction and fix build
* Document some local variables and a define
* General cleanup
* Use PlayerMeleeWeaponAnimation enum when appropiate
* Document some function parameters and local variables
* Document some of player struct
Diffstat (limited to 'soh/src/code')
| -rw-r--r-- | soh/src/code/z_actor.c | 16 | ||||
| -rw-r--r-- | soh/src/code/z_camera.c | 4 | ||||
| -rw-r--r-- | soh/src/code/z_player_lib.c | 8 |
3 files changed, 14 insertions, 14 deletions
diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index b032b9e2b..3b68f1211 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -1426,27 +1426,27 @@ void Actor_MountHorse(PlayState* play, Player* player, Actor* horse) { } s32 func_8002DEEC(Player* player) { - return (player->stateFlags1 & 0x20000080) || (player->csMode != 0); + return (player->stateFlags1 & 0x20000080) || (player->csAction != 0); } void func_8002DF18(PlayState* play, Player* player) { func_8006DC68(play, player); } -s32 func_8002DF38(PlayState* play, Actor* actor, u8 csMode) { +s32 func_8002DF38(PlayState* play, Actor* actor, u8 csAction) { Player* player = GET_PLAYER(play); - player->csMode = csMode; - player->unk_448 = actor; + player->csAction = csAction; + player->csActor = actor; player->doorBgCamIndex = 0; return true; } -s32 func_8002DF54(PlayState* play, Actor* actor, u8 csMode) { +s32 func_8002DF54(PlayState* play, Actor* actor, u8 csAction) { Player* player = GET_PLAYER(play); - func_8002DF38(play, actor, csMode); + func_8002DF38(play, actor, csAction); player->doorBgCamIndex = 1; return true; @@ -2121,8 +2121,8 @@ void func_8002F5C4(Actor* actorA, Actor* actorB, PlayState* play) { void func_8002F5F0(Actor* actor, PlayState* play) { Player* player = GET_PLAYER(play); - if (actor->xyzDistToPlayerSq < player->unk_6A4) { - player->unk_6A4 = actor->xyzDistToPlayerSq; + if (actor->xyzDistToPlayerSq < player->closestSecretDistSq) { + player->closestSecretDistSq = actor->xyzDistToPlayerSq; } } diff --git a/soh/src/code/z_camera.c b/soh/src/code/z_camera.c index e31a73dcf..ed8b9c8f4 100644 --- a/soh/src/code/z_camera.c +++ b/soh/src/code/z_camera.c @@ -4521,7 +4521,7 @@ s32 Camera_Subj4(Camera* camera) { if ((anim->unk_28 < temp_f16) && !anim->unk_2E) { player = camera->player; anim->unk_2E = true; - func_800F4010(&player->actor.projectedPos, player->unk_89E + 0x8B0, 4.0f); + func_800F4010(&player->actor.projectedPos, player->floorSfxOffset + 0x8B0, 4.0f); } else if (anim->unk_28 > temp_f16) { anim->unk_2E = false; } @@ -7732,7 +7732,7 @@ void Camera_Finish(Camera* camera) { player->actor.freezeTimer = 0; player->stateFlags1 &= ~0x20000000; - if (player->csMode != 0) { + if (player->csAction != 0) { func_8002DF54(camera->play, &player->actor, 7); osSyncPrintf("camera: player demo end!!\n"); } diff --git a/soh/src/code/z_player_lib.c b/soh/src/code/z_player_lib.c index d16fbadaf..b9a66c90e 100644 --- a/soh/src/code/z_player_lib.c +++ b/soh/src/code/z_player_lib.c @@ -573,7 +573,7 @@ uint8_t Player_IsCustomLinkModel() { } s32 Player_InBlockingCsMode(PlayState* play, Player* this) { - return (this->stateFlags1 & 0x20000080) || (this->csMode != 0) || (play->transitionTrigger == TRANS_TRIGGER_START) || + return (this->stateFlags1 & 0x20000080) || (this->csAction != 0) || (play->transitionTrigger == TRANS_TRIGGER_START) || (this->stateFlags1 & 1) || (this->stateFlags3 & 0x80) || ((gSaveContext.magicState != MAGIC_STATE_IDLE) && (Player_ActionToMagicSpell(this, this->itemAction) >= 0)); } @@ -668,7 +668,7 @@ void func_8008EC70(Player* this) { } void Player_SetEquipmentData(PlayState* play, Player* this) { - if (this->csMode != 0x56) { + if (this->csAction != 0x56) { this->currentShield = SHIELD_EQUIP_TO_PLAYER(CUR_EQUIP_VALUE(EQUIP_TYPE_SHIELD)); this->currentTunic = TUNIC_EQUIP_TO_PLAYER(CUR_EQUIP_VALUE(EQUIP_TYPE_TUNIC)); this->currentBoots = BOOTS_EQUIP_TO_PLAYER(CUR_EQUIP_VALUE(EQUIP_TYPE_BOOTS)); @@ -893,8 +893,8 @@ s32 Player_GetEnvironmentalHazard(PlayState* play) { if (play->roomCtx.curRoom.behaviorType2 == ROOM_BEHAVIOR_TYPE2_3) { // Room is hot var = 0; - } else if ((this->unk_840 > 80) && - ((this->currentBoots == PLAYER_BOOTS_IRON) || (this->unk_840 >= 300))) { // Deep underwater + } else if ((this->underwaterTimer > 80) && + ((this->currentBoots == PLAYER_BOOTS_IRON) || (this->underwaterTimer >= 300))) { // Deep underwater var = ((this->currentBoots == PLAYER_BOOTS_IRON) && (this->actor.bgCheckFlags & 1)) ? 1 : 3; } else if (this->stateFlags1 & 0x8000000) { // Swimming var = 2; |
