MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / restartMove

Method restartMove

Engine/source/T3D/aiPlayer.cpp:1439–1464  ·  view source on GitHub ↗

New method, restartMove(), restores the AIPlayer to its normal move-state following animation overrides from AFX. The tag argument is used to match the latest override and prevents interruption of overlapping animation overrides. See related anim-clip changes in Player.[h,cc].

Source from the content-addressed store, hash-verified

1437// the latest override and prevents interruption of overlapping animation
1438// overrides. See related anim-clip changes in Player.[h,cc].
1439void AIPlayer::restartMove(U32 tag)
1440{
1441 if (tag != 0 && tag == last_anim_tag)
1442 {
1443 if (mMoveState_saved != -1)
1444 {
1445 mMoveState = (MoveState) mMoveState_saved;
1446 mMoveState_saved = -1;
1447 }
1448
1449 bool is_death_anim = ((anim_clip_flags & IS_DEATH_ANIM) != 0);
1450
1451 last_anim_tag = 0;
1452 anim_clip_flags &= ~(ANIM_OVERRIDDEN | IS_DEATH_ANIM);
1453
1454 if (mDamageState != Enabled)
1455 {
1456 if (!is_death_anim)
1457 {
1458 // this is a bit hardwired and desperate,
1459 // but if he's dead he needs to look like it.
1460 setActionThread("death10", false, false, false);
1461 }
1462 }
1463 }
1464}
1465
1466// New method, saveMoveState(), stores the current movement state
1467// so that it can be restored when restartMove() is called.

Callers 2

remapAnimationMethod · 0.80
resetAnimationMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected