============== CG_CheckEvents ============== */
| 1109 | ============== |
| 1110 | */ |
| 1111 | void 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( ¢->currentState.pos, cg.snap->serverTime, cent->lerpOrigin ); |
| 1133 | CG_SetEntitySoundPosition( cent ); |
| 1134 | |
| 1135 | CG_EntityEvent( cent, cent->lerpOrigin ); |
| 1136 | } |
| 1137 |
no test coverage detected