Decompile NO3 func_801CC820 (#937)

Surrounding code also seems to use the same entity struct
This commit is contained in:
ser-pounce 2024-01-01 22:28:02 +01:00 committed by GitHub
parent 8af8569e75
commit 1c0debf74d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 1 deletions

View File

@ -655,6 +655,15 @@ typedef struct {
s32 unk88;
} ET_8016E9E4;
typedef struct {
u8 unk7C;
u8 unk7D[3];
s16 unk80;
s16 unk82;
s16 unk84;
s16 unk86;
} ET_801CC820;
typedef union {
/* 0x7C */ struct Primitive* prim;
/* 0x7C */ ET_EntFactory factory;
@ -717,5 +726,6 @@ typedef union {
/* 0x7C */ ET_Death death;
/* 0x7C */ ET_SpittleBone spittleBone;
/* 0x7C */ ET_Player player;
/* 0x7C */ ET_801CC820 et_801CC820;
/* 0x7C */ char stub[0x40];
} Ext;

View File

@ -607,7 +607,35 @@ INCLUDE_ASM("asm/us/st/no3/nonmatchings/48A84", func_801CC5A4);
INCLUDE_ASM("asm/us/st/no3/nonmatchings/48A84", func_801CC6F8);
INCLUDE_ASM("asm/us/st/no3/nonmatchings/48A84", func_801CC820);
void func_801CC820(Entity* entity) {
u16 distance;
if (entity->facingLeft == GetSideToPlayer()) {
if (entity->params == 0) {
SetStep(5);
} else {
SetStep(4);
}
return;
}
if (entity->ext.et_801CC820.unk86 == 0) {
func_801CC6F8(entity);
return;
}
distance = GetDistanceToPlayerX();
if ((distance < 0x48) && (entity->step != 4)) {
SetStep(4);
return;
}
SetStep(3);
if (distance < 0x60) {
entity->ext.et_801CC820.unk7C = 1;
} else {
entity->ext.et_801CC820.unk7C = 0;
}
entity->ext.et_801CC820.unk80 = 0;
entity->ext.et_801CC820.unk82 = 0x20;
}
void func_801CC90C(Entity* arg0) {
s16 temp_v0_2;