//
// GJGameLevel::saveNewScore from 0x14016d230 to 0x14016d3fa (458 bytes)
//
// 5 xrefs:
// > GJGameLevel::handleStatsConflict @ 0x14016fd61
// > GJGameLevel::handleStatsConflict @ 0x14016fdbc
// > PlayLayer::levelComplete @ 0x1403a82d2
// > PlayLayer::levelComplete @ 0x1403a8387
// > ??> @ 0x1406cae00
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
// Hidden C++ exception states: #wind=1
__int64 __fastcall GJGameLevel::saveNewScore(
GJGameLevel *a1,
int a2,
int a3,
int a4,
int a5,
int a6,
std::string *a7,
char a8)
{
unsigned __int8 v11; // bp
int m_bestTime; // eax
_QWORD *m_bigStorage; // rdx
int m_bestPoints; // eax
_QWORD *p_m_bigStorage; // rdx
v11 = 0;
if ( a3 )
{
if ( a2 )
{
m_bestPoints = a1->m_bestPoints;
if ( a2 > m_bestPoints || !m_bestPoints || a8 )
{
a1->m_bestPoints = a2;
a1->m_ticksPoints = a4;
a1->m_clicksPoints = a5;
a1->m_coinsPoints = a6;
a1->m_platformerSeed = sub_14016D0E0(
a1->m_bestTime,
a2,
a1->m_clicksTime,
a1->m_ticksTime,
a1->m_coinsTime,
a5,
a4,
a6);
if ( &a1->m_inputsPoints != a7 )
{
p_m_bigStorage = &a7->m_data.m_bigStorage;
if ( a7->m_data.m_capacity > 0xF )
p_m_bigStorage = a7->m_data.m_bigStorage;
sub_14003CCE0((void **)&a1->m_inputsPoints, p_m_bigStorage, a7->m_data.m_size);
}
a1->m_savedPoints = 1;
goto LABEL_20;
}
}
}
else if ( a2 > 0 )
{
m_bestTime = a1->m_bestTime;
if ( a2 < m_bestTime || !m_bestTime || a8 )
{
a1->m_bestTime = a2;
a1->m_ticksTime = a4;
a1->m_clicksTime = a5;
a1->m_coinsTime = a6;
a1->m_platformerSeed = sub_14016D0E0(
a2,
a1->m_bestPoints,
a5,
a4,
a6,
a1->m_clicksPoints,
a1->m_ticksPoints,
a1->m_coinsPoints);
if ( &a1->m_inputsTime != a7 )
{
m_bigStorage = &a7->m_data.m_bigStorage;
if ( a7->m_data.m_capacity > 0xF )
m_bigStorage = a7->m_data.m_bigStorage;
sub_14003CCE0((void **)&a1->m_inputsTime, m_bigStorage, a7->m_data.m_size);
}
a1->m_savedTime = 1;
LABEL_20:
v11 = 1;
}
}
GJGameLevel::storeNewLocalScore(a1, a2, a3);
sub_14003A830((__int64)a7);
return v11;
}