1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-29 03:34:07 +00:00

PR suggestions

This commit is contained in:
Ethan Roseman 2020-03-24 17:07:52 -04:00
parent ba31478e23
commit 05122ec2f8

View file

@ -1,3 +1,9 @@
/*
* File: z_bg_spot09_obj.c
* Overlay: ovl_Bg_Spot09_Obj
* Description:
*/
#include "z_bg_spot09_obj.h" #include "z_bg_spot09_obj.h"
#define ROOM 0x00 #define ROOM 0x00
@ -27,11 +33,10 @@ const ActorInit Bg_Spot09_Obj_InitVars = {
static u32 D_808B1F90[] = { 0x00000000, 0x06005520, 0x0600283C, 0x06008458, 0x06007580 }; static u32 D_808B1F90[] = { 0x00000000, 0x06005520, 0x0600283C, 0x06008458, 0x06007580 };
typedef s32 (*ActorFuncRet)(struct Actor*, struct GlobalContext*); static s32 (*D_808B1FA4[])(BgSpot09Obj* this, GlobalContext* globalCtx) = {
static ActorFuncRet D_808B1FA4[] = { func_808B1BEC,
(ActorFuncRet)func_808B1BEC, func_808B1AE0,
(ActorFuncRet)func_808B1AE0, func_808B1BA0,
(ActorFuncRet)func_808B1BA0,
}; };
static InitChainEntry initChain1[] = { static InitChainEntry initChain1[] = {
@ -46,37 +51,28 @@ static InitChainEntry initChain2[] = {
ICHAIN_F32(unk_FC, 1500, ICHAIN_STOP), ICHAIN_F32(unk_FC, 1500, ICHAIN_STOP),
}; };
static u32 dlists[] = { static u32 dlists[] = { 0x06000100, 0x06003970, 0x06001120, 0x06007D40, 0x06006210 };
0x06000100, 0x06003970, 0x06001120, 0x06007D40, 0x06006210,
};
extern UNK_TYPE D_06008010; extern UNK_TYPE D_06008010;
static s32 func_808B1AE0(BgSpot09Obj* this, GlobalContext* globalCtx) { static s32 func_808B1AE0(BgSpot09Obj* this, GlobalContext* globalCtx) {
s32 temp_v1; s32 carpentersRescued;
s32 linkAge;
Actor* thisx = &this->dyna.actor; Actor* thisx = &this->dyna.actor;
if (gSaveContext.scene_setup_index >= 4) { if (gSaveContext.scene_setup_index >= 4) {
return thisx->params == 0; return thisx->params == 0;
} }
temp_v1 = (gSaveContext.event_chk_inf[9] & 0xF) == 0xF; carpentersRescued = (gSaveContext.event_chk_inf[9] & 0xF) == 0xF;
if (LINK_IS_CHILD) { if (LINK_AGE_IN_YEARS == YEARS_ADULT) {
linkAge = YEARS_CHILD;
} else {
linkAge = YEARS_ADULT;
}
if (linkAge == YEARS_ADULT) {
switch (thisx->params) { switch (thisx->params) {
case 0: case 0:
return 0; return 0;
case 1: case 1:
return !temp_v1; return !carpentersRescued;
case 4: case 4:
return temp_v1; return carpentersRescued;
case 3: case 3:
return 1; return 1;
} }