//
// PlayerObject::spawnFromPlayer from 0x10022d3d4 to 0x10022d4e0 (268 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::spawnPlayer2 @ 0x1001e9e6c
//
// 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
//
// local variable allocation has failed, the output may be wrong!
void __fastcall PlayerObject::spawnFromPlayer(PlayerObject *a1, bool a2)
{
int v2; // w2
int v3; // w21
__int64 v4; // x20
char v6; // w1
double v7; // d0
double v8; // d1
v3 = v2;
v4 = a2;
((void (__fastcall *)(PlayerObject *, __int64))a1->setVisible)(a1, 1);
((void (__fastcall *)(PlayerObject *, __int64))a1->setOpacity)(a1, 255);
PlayerObject::copyAttributes(a1);
v6 = *(_BYTE *)(v4 + 2423);
if ( v3 )
{
PlayerObject::flipGravity(a1, v6 != 1, 1);
v7 = -*(double *)(v4 + 2392);
v8 = (double)(int)v7;
if ( v8 == v7 )
goto LABEL_6;
}
else
{
PlayerObject::flipGravity(a1, v6, 1);
v7 = *(double *)(v4 + 2392);
v8 = (double)(int)v7;
if ( v7 == v8 )
goto LABEL_6;
}
v7 = round((v7 - v8) * 1000.0) / 1000.0 + v8;
LABEL_6:
a1->m_yVelocity = v7;
a1->m_isOnGround = 0;
a1->m_isOnGround2 = 0;
PlayerObject::toggleVisibility(a1, (*(_BYTE *)(v4 + 1787) & 1) == 0);
if ( a1->m_isDart )
PlayerObject::placeStreakPoint(a1);
}