//
// PlayerObject::resetObject from 0x140396ee0 to 0x140397475 (1429 bytes)
//
// 4 xrefs:
// > ??> @ 0x1405c86d0
// > ??> @ 0x140697d54
// > ??> @ 0x140697de0
// > ??> @ 0x1406d63d4
//
// 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::resetObject(PlayerObject *a1)
{
GJActionManager *m_actionManager; // rbp
struct cocos2d::CCArray *v3; // rax
cocos2d::ccArray *data; // r14
__int64 num; // rax
cocos2d::CCObject **arr; // r14
cocos2d::CCObject **i; // r15
__int64 v8; // rdi
struct cocos2d::CCObject *v9; // rbx
float v10; // xmm1_4
PlayerObject_vtbl *v11; // rax
__int64 v12; // rdx
bool v13; // zf
m_actionManager = a1->m_actionManager;
a1->m_maybeReducedEffects = 1;
v3 = cocos2d::CCDictionary::allKeys(m_actionManager->m_internalActions);
if ( v3 )
{
data = v3->data;
num = data->num;
if ( (_DWORD)num )
{
arr = data->arr;
for ( i = &arr[num - 1]; arr <= i; ++arr )
{
if ( !*arr )
break;
v8 = SLODWORD((*arr)[1].__vftable);
v9 = cocos2d::CCDictionary::objectForKey(m_actionManager->m_internalActions, v8);
((void (__fastcall *)(struct cocos2d::CCObject *))v9->__vftable[1].copyWithZone)(v9);
((void (__fastcall *)(struct cocos2d::CCObject *))v9->__vftable[1].isEqual)(v9);
cocos2d::CCDictionary::removeObjectForKey(m_actionManager->m_internalActions, v8);
}
}
}
a1->m_physDeltaRelated = 0.0;
a1->m_wasTeleported = 0;
a1->m_isCollidingWithSlope = 0;
a1->m_collidedObject = nullptr;
a1->m_lastGroundObject = nullptr;
a1->m_currentSlope2 = nullptr;
a1->m_preLastGroundObject = nullptr;
a1->m_unk3e0 = 0;
a1->m_collidingWithLeft = nullptr;
a1->m_collidingWithRight = nullptr;
a1->m_scaleXRelated2 = 0.0;
a1->m_groundYVelocity = 0.0;
a1->m_scaleXRelated4 = 0.0;
a1->m_scaleXRelated3 = 0.0;
a1->m_yVelocityRelated = 0.0;
a1->m_scaleXRelated5 = 0.0;
a1->m_ringJumpRelated = 0;
a1->m_maybeReverseSpeed = 0.0;
a1->m_maybeReverseAcceleration = 0.0;
PlayerObject::doReversePlayer(a1, 0);
PlayerObject::rotateGameplay(a1, 2, 4, 0, 0.0, 0.0, 0, 0);
a1->m_platformerXVelocity = 0.0;
a1->m_maybeHasStopped = 0;
a1->m_maybeGoingCorrectSlopeDirection = 0;
a1->m_affectedByForces = 0;
a1->m_isOnIce = 0;
a1->m_scaleXRelated = 0.0;
*(_WORD *)&a1->m_platformerMovingLeft = 0;
a1->m_maybeUpsideDownSlope = 0;
a1->m_maybeSlidingTime = 0;
a1->m_maybeSlidingStartTime = 0.0;
a1->m_changedDirectionsTime = 0.0;
a1->m_controlsDisabled = 0;
a1->m_gravityMod = 1.0;
a1->m_maybeIsColliding = 0;
a1->m_isOnGround = 0;
a1->m_isOnGround2 = 1;
a1->m_lastLandTime = 0.0;
a1->m_scaleXRelatedTime = 0.0;
a1->m_fallSpeed = 0.0;
a1->m_dashRing = nullptr;
a1->m_dashStartTime = 0.0;
a1->m_platformerVelocityRelated = 0.0;
a1->m_decreaseBoostSlide = 0;
PlayerObject::toggleVisibility(a1, 1);
a1->m_flashTime = -1.0;
a1->setColor(&a1->cocos2d::CCRGBAProtocol, &a1->m_originalMainColor);
PlayerObject::setSecondColor(a1, &a1->m_originalSecondColor);
PlayerObject::stopParticles(a1);
*(_QWORD *)&a1->m_stateOnGround = 0;
*(_QWORD *)&a1->m_stateNoAutoJump = 0;
*(_QWORD *)&a1->m_stateHitHead = 0;
*(_QWORD *)&a1->m_stateBoostX = 0;
*(_QWORD *)&a1->m_maybeStateForce2 = 0;
a1->m_stateForce = 0;
cocos2d::CCPoint::operator=(&a1->m_stateForceVector, &stru_1406C2450);
sub_1400CDCD0(&a1->m_jumpPadRelated._Mypair._Myval2._Myval2._Myhead);
cocos2d::CCArray::removeAllObjects(a1->m_touchingRings);
sub_14005E0D0(&a1->m_touchedRings._Traitsobj._Mypair._Myval2._Myval2);
memset(
a1->m_playerFollowFloats._Mypair._Myval2._Myfirst,
0,
((char *)a1->m_playerFollowFloats._Mypair._Myval2._Mylast - (char *)a1->m_playerFollowFloats._Mypair._Myval2._Myfirst)
& 0xFFFFFFFFFFFFFFFCuLL);
a1->m_followRelated = 0;
a1->m_unk838 = 0.0;
PlayerObject::stopDashing(a1);
if ( !a1->m_alwaysShowStreak )
cocos2d::CCMotionStreak::stopStroke(a1->m_regularTrail);
if ( a1->m_fadeOutStreak )
{
a1->m_fadeOutStreak = 0;
if ( a1->m_playEffects )
v10 = 0.2;
else
v10 = 0.60000002;
PlayerObject::fadeOutStreak2(a1, v10);
}
PlayerObject::removePendingCheckpoint(a1);
cocos2d::CCNode::stopActionByTag(a1->m_spiderSprite, 10);
((void (__fastcall *)(GJSpiderSprite *))a1->m_spiderSprite->setScale_0)(a1->m_spiderSprite);
a1->m_checkpointTimeout = 0;
a1->m_canPlaceCheckpoint = 0;
cocos2d::CCPoint::operator=(&a1->m_lastGroundedPos, &stru_1406C2450);
a1->m_lastActivatedPortal = nullptr;
cocos2d::CCPoint::operator=(&a1->m_lastPortalPos, &stru_1406C2450);
a1->m_isLocked = 0;
a1->m_objectSnappedTo = nullptr;
a1->m_shouldTryPlacingCheckpoint = 0;
*(_WORD *)&a1->m_isOnSlope = 0;
a1->m_slopeVelocity = 0.0;
a1->m_collidingWithSlopeId = -1;
a1->m_currentSlopeYVelocity = 0.0;
a1->m_isAccelerating = 0;
a1->m_slopeRotation = 0.0;
a1->m_currentSlope = nullptr;
a1->m_currentPotentialSlope = nullptr;
sub_14005D290(&a1->m_potentialSlopeMap._Traitsobj._Mypair._Myval2._Myval2);
a1->m_unk669 = 0;
a1->m_collidedTopMinY = 0.0;
a1->m_collidedBottomMaxY = 0.0;
a1->m_collidedLeftMaxX = 0.0;
a1->m_collidedRightMinX = 0.0;
a1->m_totalTime = 0.0;
a1->m_maybeIsBoosted = 0;
a1->m_yVelocity = 0.0;
PlayerObject::flipGravity(a1, 0, 0);
PlayerObject::toggleFlyMode(a1, 0, 0);
PlayerObject::toggleBirdMode(a1, 0, 0);
PlayerObject::toggleRollMode(a1, 0, 0);
PlayerObject::toggleDartMode(a1, 0, 0);
PlayerObject::toggleRobotMode(a1, 0, 0);
PlayerObject::toggleSpiderMode(a1, 0, 0);
PlayerObject::toggleSwingMode(a1, 0, 0);
a1->m_vehicleSize = 0.60000002;
PlayerObject::togglePlayerScale(a1, 0, 0);
v11 = a1->GameObject::CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
*(_WORD *)&a1->m_isRotating = 0;
a1->m_isBallRotating = 0;
a1->m_rotationSpeed = 0.0;
((void (__fastcall *)(PlayerObject *))v11->setRotation)(a1);
a1->m_isDead = 0;
cocos2d::CCNode::stopActionByTag(a1, 4);
LOBYTE(v12) = -1;
a1->setOpacity(&a1->cocos2d::CCRGBAProtocol, v12);
PlayerObject::toggleGhostEffect(a1, (GhostType)0);
PlayerObject::updateTimeMod(a1, 0.89999998, 0);
PlayerObject::resetStreak(a1);
PlayerObject::levelFlipFinished(a1);
v13 = !a1->m_alwaysShowStreak;
a1->m_maybeReducedEffects = 0;
if ( !v13 )
PlayerObject::activateStreak(a1);
}