1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-12-29 16:26:18 +00:00

Fix UB in func_80B537E8. (#943)

This commit is contained in:
Revo 2021-09-05 14:34:37 -04:00 committed by GitHub
parent 2862aa6d03
commit d874cd08fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -173,13 +173,13 @@ s32 func_80B537E8(EnZl3* this) {
s16 yawTowardsPlayer = this->actor.yawTowardsPlayer; s16 yawTowardsPlayer = this->actor.yawTowardsPlayer;
s16* rotY = &this->actor.world.rot.y; s16* rotY = &this->actor.world.rot.y;
s16* unk_3D0 = &this->unk_3D0; s16* unk_3D0 = &this->unk_3D0;
s16 pad[3]; s16 retVal;
s16 pad[2];
Math_SmoothStepToS(unk_3D0, ABS((s16)(yawTowardsPlayer - *rotY)), 5, 6200, 100); Math_SmoothStepToS(unk_3D0, ABS((s16)(yawTowardsPlayer - *rotY)), 5, 6200, 100);
Math_SmoothStepToS(rotY, yawTowardsPlayer, 5, *unk_3D0, 100); retVal = Math_SmoothStepToS(rotY, yawTowardsPlayer, 5, *unk_3D0, 100);
this->actor.shape.rot.y = *rotY; this->actor.shape.rot.y = *rotY;
// no return statement despite being of type s32 return retVal;
// the function directly below needs this to not be void I guess
} }
void func_80B538B0(EnZl3* this) { void func_80B538B0(EnZl3* this) {