//
// PlayerObject::spawnFromPlayer from 0x347818 to 0x3478a6 (142 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::spawnPlayer2 @ 0x46f5b6
//
// 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
//
void PlayerObject::spawnFromPlayer(PlayerObject *a1, bool a2)
{
int v2; // r2
_BOOL4 v4; // r5
int v5; // r6
bool v6; // r1
double YVelocity; // r2
bool v8; // r1
v4 = a2;
v5 = v2;
a1->setVisible(a1, 1);
a1->setOpacity(a1, 255u);
PlayerObject::copyAttributes(a1);
v6 = *(_BYTE *)(v4 + 1975);
if ( v5 )
{
PlayerObject::flipGravity(a1, !v6, 1);
*(_QWORD *)&YVelocity = COERCE_UNSIGNED_INT64(PlayerObject::getYVelocity((PlayerObject *)v4)) ^ 0x8000000000000000LL;
}
else
{
PlayerObject::flipGravity(a1, v6, 1);
YVelocity = PlayerObject::getYVelocity((PlayerObject *)v4);
}
PlayerObject::setYVelocity(a1, YVelocity, 49);
v8 = *(_BYTE *)(v4 + 1491);
a1->m_isOnGround = 0;
a1->m_isOnGround2 = 0;
PlayerObject::toggleVisibility(a1, !v8);
if ( a1->m_isDart )
PlayerObject::placeStreakPoint(a1);
}