Name CoordEvent struct

This commit is contained in:
cbt6
2024-06-09 10:07:05 +08:00
parent 39a0b343e3
commit 2c636859f0
4 changed files with 20 additions and 22 deletions

View File

@@ -1,15 +1,15 @@
#ifndef POKEPLATINUM_STRUCT_0203A4AC_H
#define POKEPLATINUM_STRUCT_0203A4AC_H
typedef struct {
u16 unk_00;
u16 unk_02;
u16 unk_04;
u16 unk_06;
u16 unk_08;
u16 unk_0A;
u16 unk_0C;
u16 unk_0E;
} UnkStruct_0203A4AC;
typedef struct CoordEvent {
u16 script;
u16 x;
u16 z;
u16 width;
u16 length;
u16 y;
u16 value;
u16 var;
} CoordEvent;
#endif // POKEPLATINUM_STRUCT_0203A4AC_H

View File

@@ -17,7 +17,7 @@ int sub_0203A448(const FieldSystem * fieldSystem);
const WarpEvent * sub_0203A450(const FieldSystem * fieldSystem, int param1);
int sub_0203A468(const FieldSystem * fieldSystem, int param1, int param2);
int sub_0203A4A4(const FieldSystem * fieldSystem);
const UnkStruct_0203A4AC * sub_0203A4AC(const FieldSystem * fieldSystem);
const CoordEvent * sub_0203A4AC(const FieldSystem * fieldSystem);
u32 FieldSystem_GetNPCCount(const FieldSystem * fieldSystem);
const ObjectEvent * sub_0203A4BC(const FieldSystem * fieldSystem);
BOOL sub_0203A4C4(FieldSystem * fieldSystem, int param1, u16 param2, u16 param3);

View File

@@ -24,7 +24,7 @@ struct UnkStruct_0203A3E8_t {
const BgEvent * unk_10;
const ObjectEvent * unk_14;
const WarpEvent * unk_18;
const UnkStruct_0203A4AC * unk_1C;
const CoordEvent * unk_1C;
u32 unk_20[512];
u32 unk_820[64];
UnkStruct_ov6_02242634 unk_920;
@@ -121,7 +121,7 @@ int sub_0203A4A4 (const FieldSystem * fieldSystem)
return fieldSystem->unk_14->unk_0C;
}
const UnkStruct_0203A4AC * sub_0203A4AC (const FieldSystem * fieldSystem)
const CoordEvent * sub_0203A4AC (const FieldSystem * fieldSystem)
{
return fieldSystem->unk_14->unk_1C;
}
@@ -263,12 +263,12 @@ static void sub_0203A5B0 (UnkStruct_0203A3E8 * param0)
v0 += sizeof(u32);
if (param0->unk_0C != 0) {
param0->unk_1C = (const UnkStruct_0203A4AC *)v0;
param0->unk_1C = (const CoordEvent *)v0;
} else {
param0->unk_1C = NULL;
}
v0 += sizeof(UnkStruct_0203A4AC) * param0->unk_0C;
v0 += sizeof(CoordEvent) * param0->unk_0C;
}
void sub_0203A614 (UnkStruct_ov6_02242634 * param0, int param1)

View File

@@ -206,17 +206,15 @@ u8 sub_0203CBE0 (FieldSystem * fieldSystem, MapObject ** param1)
u16 sub_0203CC14 (FieldSystem * fieldSystem, void * param1, int param2)
{
const UnkStruct_0203A4AC * v0;
int v1, v2;
int v3;
v0 = (const UnkStruct_0203A4AC *)param1;
v1 = Player_GetXPos(fieldSystem->playerAvatar);
v2 = Player_GetZPos(fieldSystem->playerAvatar);
const CoordEvent * v0 = param1;
int v1 = Player_GetXPos(fieldSystem->playerAvatar);
int v2 = Player_GetZPos(fieldSystem->playerAvatar);
for (v3 = 0; v3 < param2; v3++) {
if ((v1 >= v0[v3].unk_02) && (v1 < (v0[v3].unk_02 + v0[v3].unk_06)) && (v2 >= v0[v3].unk_04) && (v2 < (v0[v3].unk_04 + v0[v3].unk_08)) && (sub_0203F150(fieldSystem, v0[v3].unk_0E) == v0[v3].unk_0C)) {
return v0[v3].unk_00;
if ((v1 >= v0[v3].x) && (v1 < (v0[v3].x + v0[v3].width)) && (v2 >= v0[v3].z) && (v2 < (v0[v3].z + v0[v3].length)) && (sub_0203F150(fieldSystem, v0[v3].var) == v0[v3].value)) {
return v0[v3].script;
}
}