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

Function CG_CheckEvents

code/cgame/cg_event.cpp:1111–1136  ·  view source on GitHub ↗

============== CG_CheckEvents ============== */

Source from the content-addressed store, hash-verified

1109==============
1110*/
1111void CG_CheckEvents( centity_t *cent ) {
1112 // check for event-only entities
1113 if ( cent->currentState.eType > ET_EVENTS ) {
1114 if ( cent->previousEvent ) {
1115 return; // already fired
1116 }
1117 cent->previousEvent = 1;
1118
1119 cent->currentState.event = cent->currentState.eType - ET_EVENTS;
1120 } else {
1121 // check for events riding with another entity
1122 if ( cent->currentState.event == cent->previousEvent ) {
1123 return;
1124 }
1125 cent->previousEvent = cent->currentState.event;
1126 if ( ( cent->currentState.event & ~EV_EVENT_BITS ) == 0 ) {
1127 return;
1128 }
1129 }
1130
1131 // calculate the position at exactly the frame time
1132 EvaluateTrajectory( &cent->currentState.pos, cg.snap->serverTime, cent->lerpOrigin );
1133 CG_SetEntitySoundPosition( cent );
1134
1135 CG_EntityEvent( cent, cent->lerpOrigin );
1136}
1137

Callers 2

CG_TransitionEntityFunction · 0.70
CG_SetInitialSnapshotFunction · 0.70

Calls 3

CG_EntityEventFunction · 0.70
EvaluateTrajectoryFunction · 0.50

Tested by

no test coverage detected