From 5b62b69dd17d7a689e0f439475676efddae7e7d1 Mon Sep 17 00:00:00 2001 From: tom-overton Date: Mon, 1 Nov 2021 23:33:02 -0700 Subject: [PATCH] func_80AB4160 OK --- .../actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c b/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c index 37ff47adcb..42a28d29b9 100644 --- a/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c +++ b/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c @@ -420,7 +420,37 @@ void func_80AB4080(ObjTokeidai* this, GlobalContext* globalCtx) { } } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Tokeidai/func_80AB4160.s") +void func_80AB4160(ObjTokeidai* this, GlobalContext* globalCtx) { + s32 type; + + if (func_80AB3C50(this, globalCtx) != 0) { + this->unk_16C = 0; + if ((this->actor.child == NULL)) { + type = OBJ_TOKEIDAI_TYPE(&this->actor); + if (type == 3 || type == 6) { + this->actor.child = + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HANABI, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0); + } + } + if (this->actor.child != NULL) { + if (OBJ_TOKEIDAI_TYPE(&this->actor) == 6) { + this->actor.child->home.rot.x = 0x384; + } else { + this->actor.child->home.rot.x = 0x12C; + } + } + } else { + this->actor.shape.rot.y += -0x40; + if (gSaveContext.isNight != 0) { + if (this->unk_16C < 0x64) { + this->unk_16C += +4; + } + } else if (this->unk_16C > 0) { + this->unk_16C -= 4; + } + } +} void ObjTokeidai_Update(Actor* thisx, GlobalContext* globalCtx) { ObjTokeidai* this = THIS;