papermario/src/code_10A8D0.c

18 lines
653 B
C
Raw Normal View History

2020-09-24 05:38:08 +02:00
#include "common.h"
2020-11-23 19:48:34 +01:00
void func_802E9050(Entity* entity) {
PlayerStatus* playerStatus = PLAYER_STATUS;
f32 val = fabsf(clamp_angle(180.0f - entity->rotation.y) - clamp_angle(atan2(entity->position.x, entity->position.z,
playerStatus->position.x, playerStatus->position.z)));
if ((!(playerStatus->animFlags & 1)) && (!(entity->unk_06 & 1)) && ((val <= 40.0f) || (val >= 320.0f))) {
entity->flags |= 0x1000;
if ((playerStatus->animFlags & 0x10) && (entity->unk_06 & 8)) {
func_80110678(entity);
}
} else {
entity->flags &= ~0x1000;
playerStatus->unk_C6 = -1;
}
}