//
// PlayerObject::saveToCheckpoint from 0x1403a1710 to 0x1403a21af (2719 bytes)
//
// 3 xrefs:
// > PlayLayer::createCheckpoint @ 0x1403b5067
// > PlayLayer::createCheckpoint @ 0x1403b50b7
// > ??> @ 0x1406d6974
//
// 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
void PlayerObject::saveToCheckpoint(PlayerObject *a1, PlayerCheckpoint *a2)
{
__int64 v4; // rax
__int64 v5; // rax
bool m_isDashing; // al
unsigned __int64 v7; // rax
cocos2d::CCArray *m_touchingRings; // rsi
cocos2d::ccArray *data; // rsi
__int64 num; // rax
struct cocos2d::CCObject **arr; // rsi
struct cocos2d::CCObject **i; // rbp
unsigned __int64 v13; // rax
std::unordered_set *p_m_ringRelatedSet; // [rsp+30h] [rbp+8h] BYREF
a1->getPosition_0(a1);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&p_m_ringRelatedSet);
cocos2d::CCPoint::operator=(&a2->m_position, v4);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&p_m_ringRelatedSet);
cocos2d::CCPoint::operator=(&a2->m_lastPosition, v5);
a2->m_yVelocityUnrounded = a1->m_yVelocity;
a2->m_isUpsideDown = a1->m_isUpsideDown;
a2->m_isSideways = a1->m_isSideways;
a2->m_isShip = a1->m_isShip;
a2->m_isBall = a1->m_isBall;
a2->m_isBird = a1->m_isBird;
a2->m_isDart = a1->m_isDart;
a2->m_isRobot = a1->m_isRobot;
a2->m_isSpider = a1->m_isSpider;
a2->m_isSwing = a1->m_isSwing;
a2->m_isOnGround = a1->m_isOnGround;
a2->m_ghostType = a1->m_ghostType;
a2->m_isMini = a1->m_vehicleSize != 1.0;
a2->m_playerSpeed = a1->m_playerSpeed;
a2->m_isHidden = a1->m_isHidden;
a2->m_isGoingLeft = a1->m_isGoingLeft;
a2->m_maybeReverseSpeed = a1->m_maybeReverseSpeed;
a2->m_lastFlipTime = a1->m_lastFlipTime;
a2->m_gravityMod = a1->m_gravityMod;
a2->m_decreaseBoostSlide = a1->m_decreaseBoostSlide;
a2->m_unk838 = a1->m_unk838;
a2->m_followRelated = a1->m_followRelated;
if ( &a2->m_playerFollowFloats != &a1->m_playerFollowFloats )
sub_1403A4250(
&a2->m_playerFollowFloats,
a1->m_playerFollowFloats._Mypair._Myval2._Myfirst,
a1->m_playerFollowFloats._Mypair._Myval2._Mylast - a1->m_playerFollowFloats._Mypair._Myval2._Myfirst);
a2->m_objectSnappedTo = a1->m_objectSnappedTo;
a2->m_snapDistance = a1->m_snapDistance;
a2->m_accelerationOrSpeed = a1->m_accelerationOrSpeed;
a2->m_wasOnSlope = a1->m_wasOnSlope;
a2->m_isOnSlope = a1->m_isOnSlope;
a2->m_slopeVelocity = a1->m_slopeVelocity;
m_isDashing = a1->m_isDashing;
if ( m_isDashing )
{
a2->m_isDashing = m_isDashing;
a2->m_dashAngle = a1->m_dashAngle;
a2->m_dashX = a1->m_dashX;
a2->m_dashY = a1->m_dashY;
a2->m_dashRing = a1->m_dashRing;
a2->m_dashStartTime = a1->m_dashStartTime;
}
a2->m_rotation = a1->getRotation(a1);
a2->m_wasTeleported = a1->m_wasTeleported;
a2->m_fixGravityBug = a1->m_fixGravityBug;
a2->m_reverseSync = a1->m_reverseSync;
a2->m_yVelocityBeforeSlope = a1->m_yVelocityBeforeSlope;
a2->m_slopeStartTime = a1->m_slopeStartTime;
a2->m_justPlacedStreak = a1->m_justPlacedStreak;
a2->m_lastCollisionBottom = a1->m_lastCollisionBottom;
a2->m_lastCollisionTop = a1->m_lastCollisionTop;
a2->m_lastCollisionLeft = a1->m_lastCollisionLeft;
a2->m_lastCollisionRight = a1->m_lastCollisionRight;
a2->m_unk50C = a1->m_unk50C;
a2->m_unk510 = a1->m_unk510;
a2->m_currentSlope2 = a1->m_currentSlope2;
a2->m_preLastGroundObject = a1->m_preLastGroundObject;
a2->m_slopeAngle = a1->m_slopeAngle;
a2->m_slopeSlidingMaybeRotated = a1->m_slopeSlidingMaybeRotated;
a2->m_quickCheckpointMode = a1->m_quickCheckpointMode;
a2->m_collidedObject = a1->m_collidedObject;
a2->m_lastGroundObject = a1->m_lastGroundObject;
a2->m_collidingWithLeft = a1->m_collidingWithLeft;
a2->m_collidingWithRight = a1->m_collidingWithRight;
a2->m_scaleXRelated2 = a1->m_scaleXRelated2;
a2->m_groundYVelocity = a1->m_groundYVelocity;
a2->m_yVelocityRelated = a1->m_yVelocityRelated;
a2->m_scaleXRelated3 = a1->m_scaleXRelated3;
a2->m_scaleXRelated4 = a1->m_scaleXRelated4;
a2->m_scaleXRelated5 = a1->m_scaleXRelated5;
a2->m_isCollidingWithSlope = a1->m_isCollidingWithSlope;
a2->m_isBallRotating = a1->m_isBallRotating;
a2->m_unk669 = a1->m_unk669;
a2->m_currentPotentialSlope = a1->m_currentPotentialSlope;
a2->m_currentSlope = a1->m_currentSlope;
a2->unk_584 = a1->unk_584;
a2->m_collidingWithSlopeId = a1->m_collidingWithSlopeId;
a2->m_slopeFlipGravityRelated = a1->m_slopeFlipGravityRelated;
a2->m_slopeAngleRadians = a1->m_slopeAngleRadians;
a2->m_rotationSpeed = a1->m_rotationSpeed;
a2->m_rotateSpeed = a1->m_rotateSpeed;
a2->m_isRotating = a1->m_isRotating;
a2->m_isBallRotating2 = a1->m_isBallRotating2;
a2->m_speedMultiplier = a1->m_speedMultiplier;
a2->m_yStart = a1->m_yStart;
a2->m_gravity = a1->m_gravity;
a2->m_trailingParticleLife = a1->m_trailingParticleLife;
a2->m_gameModeChangedTime = a1->m_gameModeChangedTime;
a2->m_padRingRelated = a1->m_padRingRelated;
a2->m_maybeIsFalling = a1->m_maybeIsFalling;
a2->m_shouldTryPlacingCheckpoint = a1->m_shouldTryPlacingCheckpoint;
a2->m_playEffects = a1->m_playEffects;
a2->m_isOnGround3 = a1->m_isOnGround3;
a2->m_lastSpiderFlipTime = a1->m_lastSpiderFlipTime;
a2->m_unkBool5 = a1->m_unkBool5;
a2->m_ringJumpRelated = a1->m_ringJumpRelated;
if ( &a2->m_ringRelatedSet != &a1->m_ringRelatedSet )
{
p_m_ringRelatedSet = &a2->m_ringRelatedSet;
a2->m_ringRelatedSet._Traitsobj._Mypair._Myval2._Myval2 = a1->m_ringRelatedSet._Traitsobj._Mypair._Myval2._Myval2;
sub_140269E60(
(void ****)&a2->m_ringRelatedSet._List,
*(__int64 **)a1->m_ringRelatedSet._List._Mypair._Myval2._Myhead,
(__int64 *)a1->m_ringRelatedSet._List._Mypair._Myval2._Myhead);
v7 = sub_14005F0F0((__int64)&a2->m_ringRelatedSet, a2->m_ringRelatedSet._List._Mypair._Myval2._Mysize);
sub_140062E80(&a2->m_ringRelatedSet._Traitsobj._Mypair._Myval2._Myval2, v7);
}
a2->m_maybeSpriteRelated = a1->m_maybeSpriteRelated;
a2->m_landParticlesAngle = a1->m_landParticlesAngle;
a2->m_landParticleRelatedY = a1->m_landParticleRelatedY;
a2->m_slopeRotation = a1->m_slopeRotation;
a2->m_currentSlopeYVelocity = a1->m_currentSlopeYVelocity;
a2->m_unk3d0 = a1->m_unk3d0;
a2->m_blackOrbRelated = a1->m_blackOrbRelated;
a2->m_unk3e0 = a1->m_unk3e0;
a2->m_unk3e1 = a1->m_unk3e1;
a2->m_isAccelerating = a1->m_isAccelerating;
a2->m_isCurrentSlopeTop = a1->m_isCurrentSlopeTop;
a2->m_collidedTopMinY = a1->m_collidedTopMinY;
a2->m_collidedBottomMaxY = a1->m_collidedBottomMaxY;
a2->m_collidedLeftMaxX = a1->m_collidedLeftMaxX;
a2->m_collidedRightMinX = a1->m_collidedRightMinX;
a2->m_wasJumpBuffered = a1->m_wasJumpBuffered;
a2->m_wasRobotJump = a1->m_wasRobotJump;
a2->m_stateJumpBuffered = a1->m_stateJumpBuffered;
a2->m_stateRingJump2 = a1->m_stateRingJump2;
a2->m_touchedRing = a1->m_touchedRing;
a2->m_touchedCustomRing = a1->m_touchedCustomRing;
a2->m_touchedGravityPortal = a1->m_touchedGravityPortal;
a2->m_maybeTouchedBreakableBlock = a1->m_maybeTouchedBreakableBlock;
a2->m_touchedPad = a1->m_touchedPad;
a2->m_yVelocity = a1->m_yVelocity;
a2->m_fallSpeed = a1->m_fallSpeed;
a2->m_maybeUpsideDownSlope = a1->m_maybeUpsideDownSlope;
a2->m_reverseRelated = a1->m_reverseRelated;
a2->m_maybeReverseAcceleration = a1->m_maybeReverseAcceleration;
a2->m_xVelocityRelated2 = a1->m_xVelocityRelated2;
cocos2d::CCPoint::operator=(&a2->m_shipRotation, &a1->m_shipRotation);
cocos2d::CCPoint::operator=(&a2->m_lastPortalPos, &a1->m_lastPortalPos);
a2->m_unkUnused3 = a1->m_unkUnused3;
a2->m_isOnGround2 = a1->m_isOnGround2;
a2->m_lastLandTime = a1->m_lastLandTime;
a2->m_platformerVelocityRelated = a1->m_platformerVelocityRelated;
a2->m_maybeIsBoosted = a1->m_maybeIsBoosted;
a2->m_scaleXRelatedTime = a1->m_scaleXRelatedTime;
a2->m_isLocked = a1->m_isLocked;
a2->m_controlsDisabled = a1->m_controlsDisabled;
cocos2d::CCPoint::operator=(&a2->m_lastGroundedPos, &a1->m_lastGroundedPos);
cocos2d::CCArray::removeAllObjects(a2->m_touchingRings);
m_touchingRings = a1->m_touchingRings;
if ( m_touchingRings )
{
data = m_touchingRings->data;
num = data->num;
if ( (_DWORD)num )
{
arr = data->arr;
for ( i = &arr[num - 1]; arr <= i; ++arr )
{
if ( !*arr )
break;
cocos2d::CCArray::addObject(a2->m_touchingRings, *arr);
}
}
}
if ( &a2->m_touchedRings != &a1->m_touchedRings )
{
p_m_ringRelatedSet = &a2->m_touchedRings;
a2->m_touchedRings._Traitsobj._Mypair._Myval2._Myval2 = a1->m_touchedRings._Traitsobj._Mypair._Myval2._Myval2;
sub_140269E60(
(void ****)&a2->m_touchedRings._List,
*(__int64 **)a1->m_touchedRings._List._Mypair._Myval2._Myhead,
(__int64 *)a1->m_touchedRings._List._Mypair._Myval2._Myhead);
v13 = sub_14005F0F0((__int64)&a2->m_touchedRings, a2->m_touchedRings._List._Mypair._Myval2._Mysize);
sub_140062E80(&a2->m_touchedRings._Traitsobj._Mypair._Myval2._Myval2, v13);
}
a2->m_lastActivatedPortal = a1->m_lastActivatedPortal;
a2->m_totalTime = a1->m_totalTime;
a2->m_yVelocityRelated3 = a1->m_yVelocityRelated3;
a2->m_defaultMiniIcon = a1->m_defaultMiniIcon;
a2->m_swapColors = a1->m_swapColors;
a2->m_switchDashFireColor = a1->m_switchDashFireColor;
a2->m_stateOnGround = a1->m_stateOnGround;
*(_DWORD *)&a2->m_stateUnk = *(_DWORD *)&a1->m_stateUnk;
a2->m_stateBoostX = a1->m_stateBoostX;
a2->m_stateBoostY = a1->m_stateBoostY;
a2->m_maybeStateForce2 = a1->m_maybeStateForce2;
a2->m_stateScale = a1->m_stateScale;
a2->m_platformerXVelocity = a1->m_platformerXVelocity;
a2->m_holdingRight = a1->m_holdingRight;
a2->m_holdingLeft = a1->m_holdingLeft;
a2->m_leftPressedFirst = a1->m_leftPressedFirst;
a2->m_scaleXRelated = a1->m_scaleXRelated;
a2->m_maybeHasStopped = a1->m_maybeHasStopped;
a2->m_xVelocityRelated = a1->m_xVelocityRelated;
a2->m_maybeGoingCorrectSlopeDirection = a1->m_maybeGoingCorrectSlopeDirection;
a2->m_isSliding = a1->m_isSliding;
a2->m_maybeSlopeForce = a1->m_maybeSlopeForce;
a2->m_isOnIce = a1->m_isOnIce;
a2->m_physDeltaRelated = a1->m_physDeltaRelated;
a2->m_isOnGround4 = a1->m_isOnGround4;
a2->m_maybeSlidingTime = a1->m_maybeSlidingTime;
a2->m_maybeSlidingStartTime = a1->m_maybeSlidingStartTime;
a2->m_changedDirectionsTime = a1->m_changedDirectionsTime;
a2->m_slopeEndTime = a1->m_slopeEndTime;
a2->m_isMoving = a1->m_isMoving;
a2->m_platformerMovingLeft = a1->m_platformerMovingLeft;
a2->m_platformerMovingRight = a1->m_platformerMovingRight;
a2->m_isSlidingRight = a1->m_isSlidingRight;
a2->m_maybeChangedDirectionAngle = a1->m_maybeChangedDirectionAngle;
a2->m_unkUnused2 = a1->m_unkUnused2;
a2->m_stateNoAutoJump = a1->m_stateNoAutoJump;
a2->m_stateDartSlide = a1->m_stateDartSlide;
a2->m_stateHitHead = a1->m_stateHitHead;
a2->m_stateFlipGravity = a1->m_stateFlipGravity;
a2->m_stateForce = a1->m_stateForce;
cocos2d::CCPoint::operator=(&a2->m_stateForceVector, &a1->m_stateForceVector);
a2->m_affectedByForces = a1->m_affectedByForces;
sub_140265350(
&a2->m_jumpPadRelated._Mypair._Myval2._Myval2._Myhead,
&a1->m_jumpPadRelated._Mypair._Myval2._Myval2._Myhead);
a2->m_fallStartY = a1->m_fallStartY;
}