diff options
author | Tim Angus <tim@ngus.net> | 2005-10-18 19:12:38 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2005-10-18 19:12:38 +0000 |
commit | 6c07d101613ba773c5c8b0d02e8472e058f292c5 (patch) | |
tree | 5f9cc18ce39bc1caa23fd0984099c851773c7901 | |
parent | 24c78e1f184a1b0abaa77b8d0cbcf229be222a71 (diff) |
* Fix to the multiple sound bug introduced through fixing the missing flamer bug
-rw-r--r-- | src/cgame/cg_event.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c index fa46fe36..4d176096 100644 --- a/src/cgame/cg_event.c +++ b/src/cgame/cg_event.c @@ -936,10 +936,13 @@ CG_CheckEvents */ void CG_CheckEvents( centity_t *cent ) { + entity_event_t event; + entity_event_t oldEvent = EV_NONE; + // check for event-only entities if( cent->currentState.eType > ET_EVENTS ) { - entity_event_t event = cent->currentState.eType - ET_EVENTS; + event = cent->currentState.eType - ET_EVENTS; if( cent->previousEvent ) return; // already fired @@ -951,23 +954,31 @@ void CG_CheckEvents( centity_t *cent ) // Move the pointer to the entity that the // event was originally attached to if( cent->currentState.eFlags & EF_PLAYER_EVENT ) + { cent = &cg_entities[ cent->currentState.otherEntityNum ]; - - cent->currentState.event = event; + oldEvent = cent->currentState.event; + cent->currentState.event = event; + } } + else + { + // check for events riding with another entity + if( cent->currentState.event == cent->previousEvent ) + return; - // check for events riding with another entity - if( cent->currentState.event == cent->previousEvent ) - return; - - cent->previousEvent = cent->currentState.event; - if( ( cent->currentState.event & ~EV_EVENT_BITS ) == 0 ) - return; + cent->previousEvent = cent->currentState.event; + if( ( cent->currentState.event & ~EV_EVENT_BITS ) == 0 ) + return; + } // calculate the position at exactly the frame time BG_EvaluateTrajectory( ¢->currentState.pos, cg.snap->serverTime, cent->lerpOrigin ); CG_SetEntitySoundPosition( cent ); CG_EntityEvent( cent, cent->lerpOrigin ); + + // If this was a reattached spilled event, restore the original event + if( oldEvent != EV_NONE ) + cent->currentState.event = oldEvent; } |