1
0
mirror of https://github.com/zeldaret/oot.git synced 2024-09-22 21:35:27 +00:00
oot/src/code/code_800430A0.c

61 lines
1.6 KiB
C
Raw Normal View History

#include "global.h"
2020-03-17 04:31:30 +00:00
#pragma GLOBAL_ASM("asm/non_matchings/code/code_800430A0/func_800430A0.s")
2020-03-22 21:19:43 +00:00
void func_800432A0(CollisionContext* colCtx, u32 floorPolySource, Actor* actor) {
if (func_8003E934(floorPolySource) != 0) {
2020-03-17 04:31:30 +00:00
s16 v1 = colCtx->dyna.actorMeshArr[floorPolySource].rot2.y - colCtx->dyna.actorMeshArr[floorPolySource].rot1.y;
2020-03-22 21:19:43 +00:00
if (actor->id == 0) {
((Player*)actor)->currentYaw += v1;
2020-03-22 21:19:43 +00:00
}
2020-03-17 04:31:30 +00:00
actor->shape.rot.y += v1;
actor->posRot.rot.y += v1;
}
}
2020-03-22 21:19:43 +00:00
void func_80043334(CollisionContext* colCtx, Actor* actor, u32 floorPolySource) {
if (func_8003E934(floorPolySource) != 0) {
2020-03-17 04:31:30 +00:00
DynaPolyActor* dynaActor = DynaPolyInfo_GetActor(colCtx, floorPolySource);
2020-03-22 21:19:43 +00:00
if (dynaActor != NULL) {
2020-03-17 04:31:30 +00:00
func_800434A8(dynaActor);
2020-03-22 21:19:43 +00:00
if ((actor->flags & 0x4000000) == 0x4000000) {
2020-03-17 04:31:30 +00:00
func_80043538(dynaActor);
2020-03-22 21:19:43 +00:00
}
2020-03-17 04:31:30 +00:00
}
}
}
2020-03-22 21:19:43 +00:00
s32 func_800433A4(CollisionContext* colCtx, u32 floorPolySource, Actor* actor) {
2020-03-17 04:31:30 +00:00
s32 sp24 = 0;
DynaPolyActor* dynaActor;
2020-03-22 21:19:43 +00:00
if (func_8003E934(floorPolySource) == 0) {
2020-03-17 04:31:30 +00:00
return 0;
2020-03-22 21:19:43 +00:00
}
2020-03-17 04:31:30 +00:00
2020-03-22 21:19:43 +00:00
if ((colCtx->dyna.flags[floorPolySource] & 2) || !(colCtx->dyna.flags[floorPolySource] & 1)) {
2020-03-17 04:31:30 +00:00
return 0;
2020-03-22 21:19:43 +00:00
}
2020-03-17 04:31:30 +00:00
dynaActor = DynaPolyInfo_GetActor(colCtx, floorPolySource);
2020-03-22 21:19:43 +00:00
if (dynaActor == NULL) {
2020-03-17 04:31:30 +00:00
return 0;
2020-03-22 21:19:43 +00:00
}
2020-03-17 04:31:30 +00:00
2020-03-22 21:19:43 +00:00
if (dynaActor->unk_15C & 1) {
2020-03-17 04:31:30 +00:00
func_800430A0(colCtx, floorPolySource, actor);
sp24 = 1;
}
2020-03-22 21:19:43 +00:00
if (dynaActor->unk_15C & 2) {
2020-03-17 04:31:30 +00:00
func_800432A0(colCtx, floorPolySource, actor);
sp24 = 1;
}
return sp24;
}