Location->unk_08, unk_0C => x, z

This commit is contained in:
Adrienn Tindall
2024-06-02 04:47:32 -04:00
parent c8650b9da1
commit 0e4cdd87b6
18 changed files with 83 additions and 89 deletions

View File

@@ -135,11 +135,11 @@ static inline void inline_ov47_0225621C_sub (FieldSystem * fieldSystem, int * pa
Location * location = sub_0203A72C(v0);
if (MapHeader_IsOnMainMatrix(fieldSystem->location->mapId)) {
*param1 = fieldSystem->location->unk_08;
*param2 = fieldSystem->location->unk_0C;
*param1 = fieldSystem->location->x;
*param2 = fieldSystem->location->z;
} else {
*param1 = location->unk_08;
*param2 = location->unk_0C;
*param1 = location->x;
*param2 = location->z;
}
}
@@ -154,8 +154,8 @@ static inline void Location_Init (Location * location, int mapId, int param2, in
{
location->mapId = mapId;
location->unk_04 = param2;
location->unk_08 = param3;
location->unk_0C = param4;
location->x = param3;
location->z = param4;
location->unk_10 = param5;
}

View File

@@ -4,8 +4,8 @@
typedef struct {
int mapId;
int unk_04;
int unk_08;
int unk_0C;
int x;
int z;
int unk_10;
} Location;

View File

@@ -112,7 +112,7 @@
</row>
<row id="pl_msg_00000308_00027" index="27">
<attribute name="window_context_name">used</attribute>
<language name="English">Battle Arcade\nWhere FieldEvents Sway Outcomes</language>
<language name="English">Battle Arcade\nWhere Events Sway Outcomes</language>
</row>
<row id="pl_msg_00000308_00028" index="28">
<attribute name="window_context_name">used</attribute>

View File

@@ -527,7 +527,7 @@
</row>
<row id="pl_msg_00000345_00131" index="131">
<attribute name="window_context_name">used</attribute>
<language name="English">Early Plaza FieldEvents</language>
<language name="English">Early Plaza Events</language>
</row>
<row id="pl_msg_00000345_00132" index="132">
<attribute name="window_context_name">used</attribute>

View File

@@ -278,8 +278,8 @@ static BOOL FieldMap_Exit (OverlayManager * overlayMan, int * param1)
sub_02068368(fieldSystem);
ov5_021E9338(fieldSystem->unk_28);
fieldSystem->location->unk_08 = Player_GetXPos(fieldSystem->playerAvatar);
fieldSystem->location->unk_0C = Player_GetZPos(fieldSystem->playerAvatar);
fieldSystem->location->x = Player_GetXPos(fieldSystem->playerAvatar);
fieldSystem->location->z = Player_GetZPos(fieldSystem->playerAvatar);
fieldSystem->location->unk_10 = PlayerAvatar_GetDir(fieldSystem->playerAvatar);
ov5_021EF300(fieldSystem->unk_A0);
@@ -394,9 +394,9 @@ static BOOL ov5_021D119C (FieldSystem * fieldSystem)
x = Player_GetXPos(fieldSystem->playerAvatar);
y = Player_GetZPos(fieldSystem->playerAvatar);
if ((x != fieldSystem->location->unk_08) || (y != fieldSystem->location->unk_0C)) {
fieldSystem->location->unk_08 = x;
fieldSystem->location->unk_0C = y;
if ((x != fieldSystem->location->x) || (y != fieldSystem->location->z)) {
fieldSystem->location->x = x;
fieldSystem->location->z = y;
return TRUE;
} else {
return FALSE;
@@ -841,7 +841,7 @@ static void ov5_021D17EC (FieldSystem * fieldSystem)
ov5_021E9630(fieldSystem->unk_28, ov5_021F0030, fieldSystem);
}
ov5_021E9150(fieldSystem->unk_28, fieldSystem->location->unk_08, fieldSystem->location->unk_0C);
ov5_021E9150(fieldSystem->unk_28, fieldSystem->location->x, fieldSystem->location->z);
}
static void ov5_021D1878 (FieldSystem * fieldSystem)

View File

@@ -1108,11 +1108,11 @@ static void ov5_021D2DCC (FieldSystem * fieldSystem, const int param1, const int
(*v1) = *(fieldSystem->location);
v1->unk_10 = param3;
v1->unk_08 = param1;
v1->unk_0C = param2;
v1->x = param1;
v1->z = param2;
if (param3 == 0) {
(v1->unk_0C)++;
(v1->z)++;
}
v1->mapId = fieldSystem->location->mapId;

View File

@@ -233,8 +233,8 @@ static void ov5_021E2028 (FieldSystem * fieldSystem)
sub_0203A7A8(fieldSystem);
ov5_021EA714(fieldSystem, 4, 0);
fieldSystem->location->unk_08 = Player_GetXPos(fieldSystem->playerAvatar);
fieldSystem->location->unk_0C = Player_GetZPos(fieldSystem->playerAvatar);
fieldSystem->location->x = Player_GetXPos(fieldSystem->playerAvatar);
fieldSystem->location->z = Player_GetZPos(fieldSystem->playerAvatar);
fieldSystem->location->unk_04 = -1;
fieldSystem->location->unk_10 = PlayerAvatar_GetDir(fieldSystem->playerAvatar);
}

View File

@@ -4851,8 +4851,8 @@ static int ov9_0224CEBC (UnkStruct_ov9_02249B04 * param0, UnkStruct_ov9_0224CBD8
ov5_021EA6A4(fieldSystem->unk_28, 1);
ov5_021EA6D0(fieldSystem->unk_28, 1);
param1->unk_08 = fieldSystem->location->unk_08;
param1->unk_0A = fieldSystem->location->unk_0C;
param1->unk_08 = fieldSystem->location->x;
param1->unk_0A = fieldSystem->location->z;
ov5_021EA58C(fieldSystem->unk_28, param1->unk_08, param1->unk_0A, param1->unk_10);
}

View File

@@ -1610,8 +1610,8 @@ static BOOL ov23_0224C790 (TaskManager * param0)
case 4:
v2.mapId = v1->unk_14;
v2.unk_04 = v1->unk_18;
v2.unk_08 = v1->unk_1C;
v2.unk_0C = v1->unk_20;
v2.x = v1->unk_1C;
v2.z = v1->unk_20;
v2.unk_10 = v1->unk_24;
sub_020544F0(param0, &v2);
(v1->unk_0C)++;

View File

@@ -66,8 +66,8 @@ void sub_0203A7F0 (int param0, Location * location)
location->mapId = Unk_020E97B4[param0].unk_06;
location->unk_04 = -1;
location->unk_08 = Unk_020E97B4[param0].unk_08;
location->unk_0C = Unk_020E97B4[param0].unk_0A;
location->x = Unk_020E97B4[param0].unk_08;
location->z = Unk_020E97B4[param0].unk_0A;
location->unk_10 = 1;
}
@@ -77,8 +77,8 @@ void sub_0203A824 (int param0, Location * location)
location->mapId = Unk_020E97B4[param0].unk_00;
location->unk_04 = -1;
location->unk_08 = Unk_020E97B4[param0].unk_02;
location->unk_0C = Unk_020E97B4[param0].unk_04;
location->x = Unk_020E97B4[param0].unk_02;
location->z = Unk_020E97B4[param0].unk_04;
location->unk_10 = 0;
}

View File

@@ -5006,8 +5006,8 @@ static BOOL ScrCmd_11B (ScriptContext * ctx)
location.mapId = ScriptContext_GetVar(ctx);
location.unk_04 = ScriptContext_GetVar(ctx);
location.unk_08 = ScriptContext_GetVar(ctx);
location.unk_0C = ScriptContext_GetVar(ctx);
location.x = ScriptContext_GetVar(ctx);
location.z = ScriptContext_GetVar(ctx);
location.unk_10 = ScriptContext_GetVar(ctx);
sub_0203A734(sub_0203A790(ctx->fieldSystem->saveData), &location);
@@ -7352,8 +7352,8 @@ static BOOL ScrCmd_285 (ScriptContext * ctx)
};
v2 = 0;
v3 = fieldSystem->location->unk_08;
v4 = fieldSystem->location->unk_0C;
v3 = fieldSystem->location->x;
v4 = fieldSystem->location->z;
if (v5 >= 3) {
v2 = 270;
@@ -7772,8 +7772,8 @@ static BOOL ScrCmd_2B5 (ScriptContext * ctx)
Location * location = sub_0203A72C(v3);
location->mapId = mapId;
location->unk_08 = v1;
location->unk_0C = v2;
location->x = v1;
location->z = v2;
location->unk_04 = -1;
location->unk_10 = 1;

View File

@@ -466,7 +466,7 @@ void sub_02052754 (const BattleParams * param0, FieldSystem * fieldSystem)
static int sub_02052780 (const FieldSystem * fieldSystem, int param1)
{
u8 v0 = sub_02054F94(fieldSystem, fieldSystem->location->unk_08, fieldSystem->location->unk_0C);
u8 v0 = sub_02054F94(fieldSystem, fieldSystem->location->x, fieldSystem->location->z);
static const v1[] = {
0,
7,

View File

@@ -142,7 +142,7 @@ static BOOL sub_02053570(TaskManager * taskMan);
static void FieldSystem_MapChange_SetNewLocation(FieldSystem * fieldSystem, const Location * param1);
static void sub_020533CC(FieldSystem * fieldSystem);
static void sub_02053468(FieldSystem * fieldSystem);
static void sub_02053320(FieldSystem * fieldSystem);
static void FieldSystem_MapChange_CreatePlayerObject(FieldSystem * fieldSystem);
static void sub_02053374(FieldSystem * fieldSystem);
static void sub_020534BC(FieldSystem * fieldSystem);
static BOOL sub_02053B44(TaskManager * taskMan);
@@ -222,8 +222,8 @@ static void FieldSystem_MapChange_SetNewLocation (FieldSystem * fieldSystem, con
v2 = sub_0203A450(fieldSystem, fieldSystem->location->unk_04);
fieldSystem->location->unk_08 = v2->unk_00;
fieldSystem->location->unk_0C = v2->unk_02;
fieldSystem->location->x = v2->unk_00;
fieldSystem->location->z = v2->unk_02;
if (v2->unk_06 == 0x100) {
Location * v3, * v4;
@@ -265,10 +265,10 @@ void sub_020531C0 (FieldSystem * fieldSystem, BOOL param1)
sub_02027F50(sub_02027860(fieldSystem->saveData));
}
FieldEvents * v2 = SaveData_Events(fieldSystem->saveData);
FieldEvents * events = SaveData_Events(fieldSystem->saveData);
u16 v3 = sub_0203A944(fieldSystem, mapId);
if (((v3 == 14) && (sub_0206AF0C(v2) == 1)) || ((v3 == 16) && (sub_0206AEDC(v2) == 1))) {
if (((v3 == 14) && (sub_0206AF0C(events) == 1)) || ((v3 == 16) && (sub_0206AEDC(events) == 1))) {
v3 = 0;
}
@@ -284,9 +284,7 @@ void sub_020531C0 (FieldSystem * fieldSystem, BOOL param1)
}
if (!param1) {
u16 v6;
v6 = sub_0203A858(mapId);
u16 v6 = sub_0203A858(mapId);
if (v6 != 0) {
sub_0203A764(v1, v6);
@@ -324,9 +322,7 @@ void sub_020532A8 (FieldSystem * fieldSystem, BOOL param1)
}
if (!param1) {
u16 v2;
v2 = sub_0203A858(mapId);
u16 v2 = sub_0203A858(mapId);
if (v2 != 0) {
sub_0203A764(v1, v2);
@@ -337,26 +333,26 @@ void sub_020532A8 (FieldSystem * fieldSystem, BOOL param1)
fieldSystem->unk_78.unk_02 = 0;
}
static void sub_02053320 (FieldSystem * fieldSystem)
static void FieldSystem_MapChange_CreateObjects (FieldSystem * fieldSystem)
{
int v0;
int gender;
int v1;
UnkStruct_0203A790 * v2;
PlayerData * v3;
PlayerData * playerData;
fieldSystem->mapObjMan = MapObjectMan_New(fieldSystem, 64, 5);
v0 = TrainerInfo_Gender(SaveData_GetTrainerInfo(fieldSystem->saveData));
gender = TrainerInfo_Gender(SaveData_GetTrainerInfo(fieldSystem->saveData));
v2 = sub_0203A790(fieldSystem->saveData);
v3 = sub_0203A780(v2);
playerData = sub_0203A780(v2);
fieldSystem->playerAvatar = PlayerAvatar_Init(fieldSystem->mapObjMan, fieldSystem->location->unk_08, fieldSystem->location->unk_0C, fieldSystem->location->unk_10, v3->unk_04, v0, 0, v3);
fieldSystem->playerAvatar = PlayerAvatar_Init(fieldSystem->mapObjMan, fieldSystem->location->x, fieldSystem->location->z, fieldSystem->location->unk_10, playerData->unk_04, gender, 0, playerData);
sub_0203A418(fieldSystem);
sub_02062C30(fieldSystem->mapObjMan);
}
static void sub_02053374 (FieldSystem * fieldSystem)
static void FieldSystem_MapChange_DeleteObjects (FieldSystem * fieldSystem)
{
Player_Delete(fieldSystem->playerAvatar);
MapObjectMan_DeleteAll(fieldSystem->mapObjMan);
@@ -368,13 +364,11 @@ static void sub_0205338C (FieldSystem * fieldSystem)
fieldSystem->mapObjMan = MapObjectMan_New(fieldSystem, 64, 5);
sub_0203A7C0(fieldSystem);
{
UnkStruct_0203A790 * v0 = sub_0203A790(fieldSystem->saveData);
PlayerData * v1 = sub_0203A780(v0);
int v2 = TrainerInfo_Gender(SaveData_GetTrainerInfo(fieldSystem->saveData));
UnkStruct_0203A790 * v0 = sub_0203A790(fieldSystem->saveData);
PlayerData * playerData = sub_0203A780(v0);
int v2 = TrainerInfo_Gender(SaveData_GetTrainerInfo(fieldSystem->saveData));
fieldSystem->playerAvatar = sub_0205E820(fieldSystem->mapObjMan, v1, v2);
}
fieldSystem->playerAvatar = sub_0205E820(fieldSystem->mapObjMan, playerData, v2);
sub_02062C30(fieldSystem->mapObjMan);
}
@@ -448,17 +442,17 @@ static void sub_020534EC (Location * location, const FieldSystem * fieldSystem)
static BOOL sub_02053518 (const FieldSystem * fieldSystem)
{
if (MapHeader_IsPokemonCenter2F(fieldSystem->location->mapId)
&& (fieldSystem->location->unk_08 == 7) && (fieldSystem->location->unk_0C == 6)) {
return 1;
&& (fieldSystem->location->x == 7) && (fieldSystem->location->z == 6)) {
return TRUE;
} else {
return 0;
return FALSE;
}
}
static void sub_02053540 (FieldSystem * fieldSystem)
{
Location * v0 = sub_0203A730(sub_0203A790(fieldSystem->saveData));
FieldEvents * v1 = SaveData_Events(fieldSystem->saveData);
FieldEvents * events = SaveData_Events(fieldSystem->saveData);
Location_Init(v0, fieldSystem->location->mapId, -1, 8, 2, 1);
}
@@ -473,7 +467,7 @@ static BOOL sub_02053570 (TaskManager * taskMan)
FieldSystem_MapChange_SetNewLocation(fieldSystem, fieldSystem->location);
sub_020533CC(fieldSystem);
sub_020531C0(fieldSystem, 0);
sub_02053320(fieldSystem);
FieldSystem_MapChange_CreateObjects(fieldSystem);
(*v1)++;
break;
case 1:
@@ -525,7 +519,7 @@ static BOOL sub_020535E8 (TaskManager * taskMan)
FieldSystem_MapChange_SetNewLocation(fieldSystem, sub_0203A730(v3));
sub_020533CC(fieldSystem);
sub_020531C0(fieldSystem, 0);
sub_02053320(fieldSystem);
FieldSystem_MapChange_CreateObjects(fieldSystem);
} else {
FieldSystem_MapChange_SetNewLocation(fieldSystem, NULL);
sub_020533CC(fieldSystem);
@@ -580,7 +574,7 @@ static BOOL sub_02053718 (TaskManager * taskMan)
FieldSystem_MapChange_SetNewLocation(fieldSystem, &v1->unk_04);
sub_020533CC(fieldSystem);
sub_020531C0(fieldSystem, 0);
sub_02053320(fieldSystem);
FieldSystem_MapChange_CreateObjects(fieldSystem);
sub_020534BC(fieldSystem);
(*v3)++;
break;
@@ -685,7 +679,7 @@ static BOOL sub_02053930 (TaskManager * taskMan)
switch (v2->unk_00) {
case 0:
sub_02053374(fieldSystem);
FieldSystem_MapChange_DeleteObjects(fieldSystem);
sub_02053468(fieldSystem);
(v2->unk_00)++;
break;
@@ -697,7 +691,7 @@ static BOOL sub_02053930 (TaskManager * taskMan)
(v2->unk_00)++;
break;
case 2:
sub_02053320(fieldSystem);
FieldSystem_MapChange_CreateObjects(fieldSystem);
Heap_FreeToHeap(v2);
return 1;
}
@@ -1112,8 +1106,8 @@ void * sub_02053FAC (FieldSystem * fieldSystem)
if (fieldSystem->unk_70 == 1) {
v0->unk_08 = v1->mapId;
v0->unk_0C = -1;
v0->unk_10 = v1->unk_08;
v0->unk_14 = v1->unk_0C;
v0->unk_10 = v1->x;
v0->unk_14 = v1->z;
} else {
sub_020534EC(v1, fieldSystem);
v0->unk_08 = 2;
@@ -1123,8 +1117,8 @@ void * sub_02053FAC (FieldSystem * fieldSystem)
int v2, v3;
int v4, v5;
v4 = (v1->unk_08 / 32) - 1;
v5 = (v1->unk_0C / 32) - 6;
v4 = (v1->x / 32) - 1;
v5 = (v1->z / 32) - 6;
GF_ASSERT(v4 >= 0);
GF_ASSERT(v5 >= 0);
@@ -1385,7 +1379,7 @@ static BOOL sub_02054494 (TaskManager * taskMan)
switch (v1->unk_00) {
case 0:
sub_02053374(fieldSystem);
FieldSystem_MapChange_DeleteObjects(fieldSystem);
(v1->unk_00)++;
break;
case 1:
@@ -1394,7 +1388,7 @@ static BOOL sub_02054494 (TaskManager * taskMan)
(v1->unk_00)++;
break;
case 2:
sub_02053320(fieldSystem);
FieldSystem_MapChange_CreateObjects(fieldSystem);
Heap_FreeToHeap(v1);
return 1;
}

View File

@@ -110,8 +110,8 @@ void sub_0206B70C (FieldSystem * fieldSystem, UnkStruct_0203D8AC * param1, int p
param1->unk_00 = x;
param1->unk_04 = z;
} else {
param1->unk_00 = v10->unk_08;
param1->unk_04 = v10->unk_0C;
param1->unk_00 = v10->x;
param1->unk_04 = v10->z;
}
v0 = SaveData_GetTrainerInfo(FieldSystem_SaveData(fieldSystem));

View File

@@ -101,7 +101,7 @@ void sub_02070494 (FieldSystem * fieldSystem)
UnkStruct_020556C4 * v3;
v3 = sub_0203A76C(sub_0203A790(fieldSystem->saveData));
sub_020556E8(v3, fieldSystem->location->unk_08, fieldSystem->location->unk_0C);
sub_020556E8(v3, fieldSystem->location->x, fieldSystem->location->z);
}
}

View File

@@ -65,7 +65,7 @@ BOOL sub_02070680 (TaskManager * param0)
GF_ASSERT(v2 != 0);
sub_0203A7F0(v2, &v3);
sub_02053AFC(param0, v3.mapId, -1, v3.unk_08, v3.unk_0C, 1);
sub_02053AFC(param0, v3.mapId, -1, v3.x, v3.z, 1);
Heap_FreeToHeap(v1);
}

View File

@@ -172,7 +172,7 @@ void sub_020716D4 (FieldSystem * fieldSystem)
switch (fieldSystem->location->mapId) {
case 291:
if (fieldSystem->location->unk_0C == 26) {
if (fieldSystem->location->z == 26) {
v1->unk_00 = 0;
} else {
v1->unk_00 = 1;
@@ -181,7 +181,7 @@ void sub_020716D4 (FieldSystem * fieldSystem)
v1->unk_02 = 0;
break;
case 293:
if (fieldSystem->location->unk_0C == (32 * 1 + 16)) {
if (fieldSystem->location->z == (32 * 1 + 16)) {
v1->unk_00 = 0;
} else {
v1->unk_00 = 1;
@@ -190,7 +190,7 @@ void sub_020716D4 (FieldSystem * fieldSystem)
v1->unk_02 = 1;
break;
case 294:
if (fieldSystem->location->unk_0C == 15) {
if (fieldSystem->location->z == 15) {
v1->unk_00 = 0;
} else {
v1->unk_00 = 1;
@@ -199,7 +199,7 @@ void sub_020716D4 (FieldSystem * fieldSystem)
v1->unk_02 = 2;
break;
case 176:
if (fieldSystem->location->unk_0C == 15) {
if (fieldSystem->location->z == 15) {
v1->unk_00 = 0;
} else {
v1->unk_00 = 1;
@@ -210,7 +210,7 @@ void sub_020716D4 (FieldSystem * fieldSystem)
v1->unk_08 = 1;
break;
case 178:
if (fieldSystem->location->unk_0C == 15) {
if (fieldSystem->location->z == 15) {
v1->unk_00 = 0;
} else {
v1->unk_00 = 1;
@@ -221,7 +221,7 @@ void sub_020716D4 (FieldSystem * fieldSystem)
v1->unk_08 = 1;
break;
case 180:
if (fieldSystem->location->unk_0C == 15) {
if (fieldSystem->location->z == 15) {
v1->unk_00 = 0;
} else {
v1->unk_00 = 1;
@@ -232,7 +232,7 @@ void sub_020716D4 (FieldSystem * fieldSystem)
v1->unk_08 = 1;
break;
case 182:
if (fieldSystem->location->unk_0C == 15) {
if (fieldSystem->location->z == 15) {
v1->unk_00 = 0;
} else {
v1->unk_00 = 1;
@@ -243,7 +243,7 @@ void sub_020716D4 (FieldSystem * fieldSystem)
v1->unk_08 = 1;
break;
case 184:
if (fieldSystem->location->unk_0C == 23) {
if (fieldSystem->location->z == 23) {
v1->unk_00 = 0;
} else {
v1->unk_00 = 1;
@@ -254,7 +254,7 @@ void sub_020716D4 (FieldSystem * fieldSystem)
v1->unk_08 = 1;
break;
case 185:
if (fieldSystem->location->unk_0C == 18) {
if (fieldSystem->location->z == 18) {
v1->unk_00 = 0;
} else {
v1->unk_00 = 1;

View File

@@ -110,7 +110,7 @@ void sub_02071B6C (FieldSystem * fieldSystem, const u8 param1)
GF_ASSERT(0);
}
if (fieldSystem->location->unk_0C == v2) {
if (fieldSystem->location->z == v2) {
v1->unk_00 = 0;
}
}