diff options
-rw-r--r-- | src/cgame/cg_event.c | 5 | ||||
-rw-r--r-- | src/game/bg_local.h | 3 | ||||
-rw-r--r-- | src/game/bg_pmove.c | 6 | ||||
-rw-r--r-- | src/game/bg_public.h | 1 |
4 files changed, 15 insertions, 0 deletions
diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c index 4a5dcef6..83d95424 100644 --- a/src/cgame/cg_event.c +++ b/src/cgame/cg_event.c @@ -460,6 +460,11 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) } break; + case EV_FALLING: + DEBUGNAME( "EV_FALLING" ); + trap_S_StartSound( NULL, es->number, CHAN_AUTO, CG_CustomSound( es->number, "*falling1.wav" ) ); + break; + case EV_STEP_4: case EV_STEP_8: case EV_STEP_12: diff --git a/src/game/bg_local.h b/src/game/bg_local.h index 603d57a7..951ed385 100644 --- a/src/game/bg_local.h +++ b/src/game/bg_local.h @@ -25,6 +25,9 @@ #define OVERCLIP 1.001f +#define FALLING_THRESHOLD -600.0f //what vertical speed to start falling sound at + + // all of the locals will be zeroed before each // pmove, just to make damn sure we don't have // any differences when running on client or server diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index 6781a530..79399019 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -1692,6 +1692,12 @@ static void PM_GroundTraceMissed( void ) } } + if( BG_ClassHasAbility( pm->ps->stats[ STAT_PCLASS ], SCA_TAKESFALLDAMAGE ) ) + { + if( pm->ps->velocity[ 2 ] < FALLING_THRESHOLD && pml.previous_velocity[ 2 ] >= FALLING_THRESHOLD ) + PM_AddEvent( EV_FALLING ); + } + pm->ps->groundEntityNum = ENTITYNUM_NONE; pml.groundPlane = qfalse; pml.walking = qfalse; diff --git a/src/game/bg_public.h b/src/game/bg_public.h index 2027a339..0e256ca1 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -491,6 +491,7 @@ typedef enum EV_FALL_SHORT, EV_FALL_MEDIUM, EV_FALL_FAR, + EV_FALLING, EV_JUMP_PAD, // boing sound at origin, jump sound on player |