Rename head turn speed variable

This commit is contained in:
JordanLongstaff 2025-06-02 18:42:54 -04:00
parent 808bbc44dd
commit 242f918f0e
2 changed files with 9 additions and 9 deletions

View File

@ -1311,7 +1311,7 @@ void EnRu1_UpdateHeadRotation(EnRu1* this) {
s32 headRotOffset; s32 headRotOffset;
s16* headRotTimer = &this->headRotTimer; s16* headRotTimer = &this->headRotTimer;
s16* headRotY = &this->interactInfo.headRot.y; s16* headRotY = &this->interactInfo.headRot.y;
s16* headRotAngle = &this->headRotAngle; s16* headTurnSpeed = &this->headTurnSpeed;
s32 pad[2]; s32 pad[2];
if (DECR(*headRotTimer) == 0) { if (DECR(*headRotTimer) == 0) {
@ -1324,18 +1324,18 @@ void EnRu1_UpdateHeadRotation(EnRu1* this) {
} else { } else {
this->headRotDirection = 0; this->headRotDirection = 0;
} }
*headRotAngle = 0; *headTurnSpeed = 0;
} }
if (this->headRotDirection == 0) { if (this->headRotDirection == 0) {
Math_SmoothStepToS(headRotAngle, 0 - *headRotY, 1, 0x190, 0x190); Math_SmoothStepToS(headTurnSpeed, 0 - *headRotY, 1, 0x190, 0x190);
Math_SmoothStepToS(headRotY, 0, 3, ABS(*headRotAngle), 0x64); Math_SmoothStepToS(headRotY, 0, 3, ABS(*headTurnSpeed), 0x64);
} else if (this->headRotDirection == 1) { } else if (this->headRotDirection == 1) {
Math_SmoothStepToS(headRotAngle, -0x2AAA - *headRotY, 1, 0x190, 0x190); Math_SmoothStepToS(headTurnSpeed, -0x2AAA - *headRotY, 1, 0x190, 0x190);
Math_SmoothStepToS(headRotY, -0x2AAA, 3, ABS(*headRotAngle), 0x64); Math_SmoothStepToS(headRotY, -0x2AAA, 3, ABS(*headTurnSpeed), 0x64);
} else { } else {
Math_SmoothStepToS(headRotAngle, 0x2AAA - *headRotY, 1, 0x190, 0x190); Math_SmoothStepToS(headTurnSpeed, 0x2AAA - *headRotY, 1, 0x190, 0x190);
Math_SmoothStepToS(headRotY, 0x2AAA, 3, ABS(*headRotAngle), 0x64); Math_SmoothStepToS(headRotY, 0x2AAA, 3, ABS(*headTurnSpeed), 0x64);
} }
} }

View File

@ -38,7 +38,7 @@ typedef struct EnRu1 {
/* 0x0294 */ char unk_294[0x4]; /* 0x0294 */ char unk_294[0x4];
/* 0x0298 */ s32 unk_298; /* 0x0298 */ s32 unk_298;
/* 0x029C */ char unk_29C[0x2]; /* 0x029C */ char unk_29C[0x2];
/* 0x029E */ s16 headRotAngle; /* 0x029E */ s16 headTurnSpeed;
/* 0x02A0 */ char unk_2A0[0x4]; /* 0x02A0 */ char unk_2A0[0x4];
/* 0x02A4 */ f32 unk_2A4; /* 0x02A4 */ f32 unk_2A4;
/* 0x02A8 */ s32 alpha; /* 0x02A8 */ s32 alpha;