Skip to content

Commit b20c6ca

Browse files
committed
Matches
1 parent f2c64da commit b20c6ca

2 files changed

Lines changed: 37 additions & 21 deletions

File tree

LEGORacers/include/citrinegrove0x1f4c.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class CitrineGrove0x1f4c {
2020

2121
void FUN_004432d0();
2222
void FUN_004432e0(undefined4* p_arg1, undefined4 p_arg2);
23-
undefined4 FUN_00443420(undefined4, undefined4);
23+
undefined4 FUN_00443420(LegoU32 p_index, undefined4 p_arg2);
2424
undefined4 FUN_004434a0(undefined4);
2525
void FUN_00443520(undefined4);
2626
void FUN_004435c0();

LEGORacers/src/citrinegrove0x1f4c.cpp

Lines changed: 36 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
DECOMP_SIZE_ASSERT(CitrineGrove0x1f4c, 0x1f4c)
1010
DECOMP_SIZE_ASSERT(MarigoldTrail0x108, 0x108)
1111

12+
// GLOBAL: LEGORACERS 0x004bef80
13+
const LegoChar* g_defaultSaveFileName = "default.lrs";
14+
15+
// GLOBAL: LEGORACERS 0x004bef84
16+
const LegoChar* g_quickBuildSaveFileName = "qbuild.lrs";
17+
1218
// FUNCTION: LEGORACERS 0x00443120
1319
CitrineGrove0x1f4c::CitrineGrove0x1f4c()
1420
{
@@ -44,42 +50,47 @@ void CitrineGrove0x1f4c::FUN_004432e0(undefined4* p_arg1, undefined4 p_arg2)
4450
else {
4551
path[0] = '\0';
4652
}
53+
4754
::strcat(path, "Save\\");
4855
FUN_00450fc0(path);
4956
m_unk0x108.FUN_004426d0(5, 1, 0);
5057
m_unk0x18c4.FUN_0042ef80(&m_unk0x108);
5158
FUN_00443520(p_arg2);
5259
m_unk0x5b0.FUN_004426d0(4, 3, 0);
53-
FUN_00443620("default.lrs", &m_unk0x5b0);
60+
FUN_00443620(g_defaultSaveFileName, &m_unk0x5b0);
5461
m_unk0x1418.FUN_004426d0(36, 3, 0);
55-
FUN_00443620("qbuild.lrs", &m_unk0x1418);
62+
FUN_00443620(g_quickBuildSaveFileName, &m_unk0x1418);
5663
m_unk0x1cfc.FUN_0042b2f0(4, 0, 0, 0);
5764
}
5865

5966
// FUNCTION: LEGORACERS 0x00443420
60-
undefined4 CitrineGrove0x1f4c::FUN_00443420(undefined4 p_index, undefined4 p_arg2)
67+
undefined4 CitrineGrove0x1f4c::FUN_00443420(LegoU32 p_index, undefined4 p_arg2)
6168
{
62-
LegoS32 result = m_unk0xa58[p_index].FUN_00443910();
63-
if (result == 0) {
64-
result = m_unk0xa58[p_index].FUN_00443980();
65-
if (result != 0) {
66-
return result;
67-
}
68-
result = 0;
69-
}
70-
else if (result == 8) {
71-
if (p_arg2 == 0) {
72-
return 8;
69+
PeridotTrace0x4e0* entry = &m_unk0xa58[p_index];
70+
undefined4 status = entry->FUN_00443910();
71+
72+
if (status == 0) {
73+
undefined4 result = entry->FUN_00443980();
74+
75+
if (result == 0 && m_unk0x18c4.GetUnk0x04() == -1) {
76+
m_unk0x18c4.FUN_0042eb60(entry, p_index);
7377
}
74-
result = m_unk0xa58[p_index].FUN_00443940();
75-
}
76-
else {
78+
7779
return result;
7880
}
79-
if (m_unk0x18c4.GetUnk0x04() == -1) {
80-
m_unk0x18c4.FUN_0042eb60(&m_unk0xa58[p_index], p_index);
81+
else if (status == 8) {
82+
if (p_arg2 != 0) {
83+
undefined4 result = entry->FUN_00443940();
84+
85+
if (m_unk0x18c4.GetUnk0x04() == -1) {
86+
m_unk0x18c4.FUN_0042eb60(entry, p_index);
87+
}
88+
89+
return result;
90+
}
8191
}
82-
return result;
92+
93+
return status;
8394
}
8495

8596
// FUNCTION: LEGORACERS 0x004434a0
@@ -90,9 +101,11 @@ undefined4 CitrineGrove0x1f4c::FUN_004434a0(undefined4 p_index)
90101
m_unk0x18c4.SetUnk0x00(0);
91102
return m_unk0xa58[p_index].FUN_004439b0();
92103
}
104+
93105
if (m_unk0xa58[p_index].GetUnk0x20()) {
94106
return m_unk0xa58[p_index].FUN_004439b0();
95107
}
108+
96109
return 0;
97110
}
98111

@@ -117,15 +130,18 @@ void CitrineGrove0x1f4c::FUN_00443620(const LegoChar* p_fileName, PeridotTrace0x
117130
if (file == NULL) {
118131
GOL_FATALERROR(c_golErrorOutOfMemory);
119132
}
133+
120134
if (file->BufferedOpen(p_fileName, GolFile::c_modeRead, 1024)) {
121135
if (file != NULL) {
122136
delete file;
123137
}
124138
return;
125139
}
140+
126141
if (p_arg2->FUN_00442770(*file)) {
127142
GOL_FATALERROR_MESSAGE("Corrupt install - invalid default save file");
128143
}
144+
129145
file->Dispose();
130146
if (file != NULL) {
131147
delete file;

0 commit comments

Comments
 (0)