MCPcopy Create free account
hub / github.com/JACoders/OpenJK / PM_SetTorsoAnimTimer

Function PM_SetTorsoAnimTimer

codeJK2/game/bg_panimate.cpp:2084–2108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2082*/
2083
2084void PM_SetTorsoAnimTimer( gentity_t *ent, int *torsoAnimTimer, int time )
2085{
2086 *torsoAnimTimer = time;
2087
2088 if ( *torsoAnimTimer < 0 && time != -1 )
2089 {//Cap timer to 0 if was counting down, but let it be -1 if that was intentional
2090 *torsoAnimTimer = 0;
2091 }
2092
2093 if ( !*torsoAnimTimer && ent && Q3_TaskIDPending( ent, TID_ANIM_UPPER ) )
2094 {//Waiting for torsoAnimTimer to complete, and it just got set to zero
2095 if ( !Q3_TaskIDPending( ent, TID_ANIM_BOTH) )
2096 {//Not waiting for bottom
2097 Q3_TaskIDComplete( ent, TID_ANIM_UPPER );
2098 }
2099 else
2100 {//Waiting for both to finish before complete
2101 Q3_TaskIDClear( &ent->taskID[TID_ANIM_UPPER] );//Top is done, regardless
2102 if ( !Q3_TaskIDPending( ent, TID_ANIM_LOWER) )
2103 {//lower is done and we're done
2104 Q3_TaskIDComplete( ent, TID_ANIM_BOTH );
2105 }
2106 }
2107 }
2108}
2109
2110extern qboolean PM_SpinningSaberAnim( int anim );
2111extern float saberAnimSpeedMod[NUM_FORCE_POWER_LEVELS];

Callers 6

player_dieFunction · 0.70
Q3_SetAnimHoldTimeFunction · 0.70
PM_DropTimersFunction · 0.70
PM_SetAnimFinalFunction · 0.70
PM_SetAnimFunction · 0.70
NPC_SetAnimFunction · 0.70

Calls 3

Q3_TaskIDPendingFunction · 0.70
Q3_TaskIDCompleteFunction · 0.70
Q3_TaskIDClearFunction · 0.70

Tested by

no test coverage detected