From c9cd49156309f29a8576ac17788dfd6ead583cc4 Mon Sep 17 00:00:00 2001 From: Mikko Tiusanen Date: Tue, 2 Sep 2014 23:22:24 +0300 Subject: Hummel can now stop mid-air by using the walk key. --- src/game/bg_pmove.c | 9 ++++++--- src/game/g_active.c | 2 +- src/game/g_weapon.c | 2 -- 3 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src/game') diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index cb215a3..c78129b 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -51,6 +51,7 @@ float pm_friction = 6.0f; float pm_waterfriction = 1.0f; float pm_flightfriction = 6.0f; float pm_hummelfriction = 2.5f; +float pm_hummelwalkfriction = 8.0f; float pm_spectatorfriction = 5.0f; int c_pmove = 0; @@ -262,7 +263,7 @@ static void PM_Friction( void ) vec3_t vec; float *vel; float speed, newspeed, control; - float drop; + float drop, modifier; vel = pm->ps->velocity; @@ -323,7 +324,10 @@ static void PM_Friction( void ) } */ if( pm->ps->pm_type == PM_HUMMEL /*&& pm->ps->torsoTimer <= 0*/ ) - drop += speed * pm_hummelfriction * pml.frametime; + { + modifier = ( pm->cmd.buttons & BUTTON_WALKING ) ? pm_hummelwalkfriction : pm_hummelfriction; + drop += speed * modifier * pml.frametime; + } // scale the velocity newspeed = speed - drop; @@ -337,7 +341,6 @@ static void PM_Friction( void ) vel[ 2 ] = vel[ 2 ] * newspeed; } - /* ============== PM_Accelerate diff --git a/src/game/g_active.c b/src/game/g_active.c index 3c888a6..af29923 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -1754,7 +1754,7 @@ void ClientThink_real( gentity_t *ent ) client->ps.pm_type = PM_GRABBED; else if( BG_InventoryContainsUpgrade( UP_JETPACK, client->ps.stats ) && BG_UpgradeIsActive( UP_JETPACK, client->ps.stats ) ) client->ps.pm_type = PM_JETPACK; - else if( client->ps.weapon == WP_ALEVEL5 /*&& client->buttons & BUTTON_WALKING*/ ) + else if( client->ps.weapon == WP_ALEVEL5 ) //hummel fly client->ps.pm_type = PM_HUMMEL; else diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index feee414..740ab32 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -1732,8 +1732,6 @@ void Prickles( gentity_t *ent ) vec3_t end; float r; float u; - gentity_t *tent; - gentity_t *traceEnt; r = random( ) * M_PI * 2.0f; u = sin( r ) * crandom( ) * LEVEL5_PRICKLES_SPREAD * 16; -- cgit