//
// GJBaseGameLayer::playerWillSwitchMode from 0x9e699c to 0x9e6b78 (476 bytes)
//
// 10 xrefs:
// > GJBaseGameLayer::toggleDualMode @ 0x9e6d9c
// > GJBaseGameLayer::collisionCheckObjects @ 0x9e8b20
// > GJBaseGameLayer::collisionCheckObjects @ 0x9e8b94
// > GJBaseGameLayer::collisionCheckObjects @ 0x9e8dc8
// > GJBaseGameLayer::collisionCheckObjects @ 0x9e8e14
// > GJBaseGameLayer::collisionCheckObjects @ 0x9e9058
// > GJBaseGameLayer::collisionCheckObjects @ 0x9e91c0
// > GJBaseGameLayer::collisionCheckObjects @ 0x9e937c
// > GJBaseGameLayer::collisionCheckObjects @ 0x9e93f0
// > ??> @ 0xa0108
//
// 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 12:59:00 +0000
//
__int64 __fastcall GJBaseGameLayer::playerWillSwitchMode(__int64 this, PlayerObject *a2, GameObject *a3)
{
__int64 v3; // x20
int v6; // w0
int v7; // w0
unsigned int v8; // w0
int v9; // w0
unsigned __int8 *OtherPlayer; // x22
unsigned int v11; // w1
v3 = this;
if ( a3 )
{
*(_QWORD *)(this + 976) = a3;
if ( *((_DWORD *)a3 + 312) == 1 )
GJBaseGameLayer::updateCameraMode(this, a3, 0);
v6 = (*(__int64 (__fastcall **)(GameObject *))(*(_QWORD *)a3 + 1800LL))(a3);
GJBaseGameLayer::updateDualGround((GJBaseGameLayer *)v3, a2, v6, 0, 0.0);
v7 = (*(__int64 (__fastcall **)(GameObject *))(*(_QWORD *)a3 + 1800LL))(a3);
v8 = GJBaseGameLayer::objectTypeToGameEvent((GJBaseGameLayer *)v3, v7);
GJBaseGameLayer::gameEventTriggered(v3, v8, 0, 0);
v9 = (*(__int64 (__fastcall **)(GameObject *))(*(_QWORD *)a3 + 1800LL))(a3);
if ( v9 == 5 || v9 == 19 || v9 == 26 || v9 == 41 )
{
this = *(unsigned __int8 *)(v3 + 1010);
if ( !*(_BYTE *)(v3 + 1010) )
return this;
}
else
{
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v3 + 1288LL))(v3, 0);
this = *(unsigned __int8 *)(v3 + 1010);
if ( !*(_BYTE *)(v3 + 1010) )
return this;
}
this = *(unsigned __int8 *)(*(_QWORD *)(v3 + 3272) + 340LL);
if ( !*(_BYTE *)(*(_QWORD *)(v3 + 3272) + 340LL) )
{
OtherPlayer = (unsigned __int8 *)GJBaseGameLayer::getOtherPlayer((GJBaseGameLayer *)v3, a2);
this = (*(unsigned int (__fastcall **)(GameObject *))(*(_QWORD *)a3 + 1800LL))(a3) - 5;
switch ( (int)this )
{
case 0:
v11 = OtherPlayer[2417];
goto LABEL_16;
case 1:
this = (unsigned __int8)PlayerObject::isFlying((PlayerObject *)OtherPlayer);
if ( (_BYTE)this )
return this;
this = OtherPlayer[2419];
if ( OtherPlayer[2419] )
return this;
this = OtherPlayer[2421];
if ( OtherPlayer[2421] )
return this;
this = OtherPlayer[2422];
if ( OtherPlayer[2422] )
return this;
this = *(unsigned __int8 *)(v3 + 1912);
if ( *(_BYTE *)(v3 + 1912) )
return this;
goto LABEL_17;
case 11:
v11 = OtherPlayer[2419];
goto LABEL_16;
case 14:
v11 = OtherPlayer[2418];
goto LABEL_16;
case 22:
v11 = OtherPlayer[2421];
goto LABEL_16;
case 28:
v11 = OtherPlayer[2422];
goto LABEL_16;
case 36:
v11 = OtherPlayer[2428];
LABEL_16:
this = *(unsigned __int8 *)(v3 + 1912);
if ( (unsigned int)this < v11 )
LABEL_17:
this = PlayerObject::flipGravity((__int64)a2, OtherPlayer[2423] ^ 1u, 1u);
break;
default:
return this;
}
}
}
return this;
}