//
// LevelEditorLayer::checkAutoSave from 0x1003ffc3c to 0x1003ffd78 (316 bytes)
//
// 1 xrefs:
// > LevelEditorLayer::updateEditor @ 0x1003f8218
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:04:38 +0000
//
__int64 __fastcall LevelEditorLayer::checkAutoSave(__int64 a1, float a2)
{
__int64 v4; // x0
__int64 v5; // x0
int IntGameVariable; // w0
int v7; // w8
float v8; // s0
__int64 v9; // x0
__int64 result; // x0
__int64 v11; // x0
unsigned int v12; // w8
__int64 v13; // x9
float v14; // s8
int v15; // w10
v4 = GameManager::sharedState();
if ( GameManager::getGameVariable(v4, "0184") )
{
v5 = GameManager::sharedState();
IntGameVariable = GameManager::getIntGameVariable(v5, "0185");
v7 = IntGameVariable >= 1 ? IntGameVariable : 300;
v8 = *(float *)(a1 + 15056) + a2;
*(float *)(a1 + 15056) = v8;
if ( v8 >= (float)v7 )
{
if ( (unsigned int)LevelEditorLayer::canAutoSave(a1) )
{
*(_DWORD *)(a1 + 15056) = 0;
LevelEditorLayer::doAutoSave(a1);
}
}
}
v9 = GameManager::sharedState();
result = GameManager::getGameVariable(v9, "0186");
if ( (_DWORD)result )
{
v11 = GameManager::sharedState();
result = GameManager::getIntGameVariable(v11, "0187");
if ( (int)result <= 600 )
v12 = 600;
else
v12 = result;
v13 = *(_QWORD *)(a1 + 1936);
if ( (int)result < 1 )
v12 = 3600;
v14 = *(double *)(a1 + 14688) + (double)*(int *)(v13 + 652);
v15 = *(_DWORD *)(v13 + 1464);
if ( v15 < 1 || (float)(unsigned int)v15 > v14 )
{
v15 = (int)v14;
*(_DWORD *)(v13 + 1464) = (int)v14;
}
if ( (float)(v14 - (float)v15) >= (float)v12 )
{
result = LevelEditorLayer::canAutoSave(a1);
if ( (_DWORD)result )
{
*(_DWORD *)(*(_QWORD *)(a1 + 1936) + 1464LL) = (int)v14;
return LevelEditorLayer::doAutoBackup(a1);
}
}
}
return result;
}