1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-19 21:41:59 +00:00

Document/fix Player.bodyPartsPos usage (#1141)

* Document/fix `Player#bodyPartsPos` usage

* `distFromLinksHead` -> `distFromPlayerHat`

* Comment on `bodyPartsPos[-1]`

* Run formatter

* Use `PLAYER_BODYPART_MAX` more

* Use hex for `PlayerBodyPart` enum comments
This commit is contained in:
Dragorn421 2022-03-09 01:50:27 +01:00 committed by GitHub
parent c73053db6f
commit 5cadc5df8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 166 additions and 120 deletions

View file

@ -180,9 +180,10 @@ void ShotSun_UpdateHyliaSun(ShotSun* this, GlobalContext* globalCtx) {
Actor_Kill(&this->actor);
} else {
if (!(this->actor.xzDistToPlayer > 120.0f) && gSaveContext.dayTime >= 0x4555 && gSaveContext.dayTime < 0x5000) {
cylinderPos.x = player->bodyPartsPos[7].x + globalCtx->envCtx.sunPos.x * (1.0f / 6.0f);
cylinderPos.y = player->bodyPartsPos[7].y - 30.0f + globalCtx->envCtx.sunPos.y * (1.0f / 6.0f);
cylinderPos.z = player->bodyPartsPos[7].z + globalCtx->envCtx.sunPos.z * (1.0f / 6.0f);
cylinderPos.x = player->bodyPartsPos[PLAYER_BODYPART_HEAD].x + globalCtx->envCtx.sunPos.x * (1.0f / 6.0f);
cylinderPos.y =
player->bodyPartsPos[PLAYER_BODYPART_HEAD].y - 30.0f + globalCtx->envCtx.sunPos.y * (1.0f / 6.0f);
cylinderPos.z = player->bodyPartsPos[PLAYER_BODYPART_HEAD].z + globalCtx->envCtx.sunPos.z * (1.0f / 6.0f);
this->hitboxPos = cylinderPos;