diff options
-rw-r--r-- | src/cgame/cg_view.c | 10 | ||||
-rw-r--r-- | src/game/g_cmds.c | 8 |
2 files changed, 14 insertions, 4 deletions
diff --git a/src/cgame/cg_view.c b/src/cgame/cg_view.c index 5460938f..c60695b0 100644 --- a/src/cgame/cg_view.c +++ b/src/cgame/cg_view.c @@ -546,7 +546,7 @@ static void CG_StepOffset( void ) #define PCLOUD_ROLL_AMPLITUDE 25.0f #define PCLOUD_ROLL_FREQUENCY 0.4f #define PCLOUD_ZOOM_AMPLITUDE 15 -#define PCLOUD_ZOOM_FREQUENCY 0.7f +#define PCLOUD_ZOOM_FREQUENCY 0.625f // 2.5s / 4 #define PCLOUD_DISORIENT_DURATION 2500 @@ -765,8 +765,10 @@ void CG_OffsetFirstPersonView( void ) BG_PlayerPoisonCloudTime( &cg.predictedPlayerState ); if( scale < 0.0f ) scale = 0.0f; - fraction = sin( cg.time / 500.0f * M_PI * PCLOUD_ROLL_FREQUENCY ) * scale; - pitchFraction = sin( cg.time / 200.0f * M_PI * PCLOUD_ROLL_FREQUENCY ) * + + fraction = sin( ( cg.time - cg.poisonedTime ) / 500.0f * M_PI * PCLOUD_ROLL_FREQUENCY ) * + scale; + pitchFraction = sin( ( cg.time - cg.poisonedTime ) / 200.0f * M_PI * PCLOUD_ROLL_FREQUENCY ) * scale; angles[ ROLL ] += fraction * PCLOUD_ROLL_AMPLITUDE; @@ -991,7 +993,7 @@ static int CG_CalcFov( void ) float scale = 1.0f - (float)( cg.time - cg.poisonedTime ) / BG_PlayerPoisonCloudTime( &cg.predictedPlayerState ); - phase = cg.time / 1000.0 * PCLOUD_ZOOM_FREQUENCY * M_PI * 2; + phase = ( cg.time - cg.poisonedTime ) / 1000.0 * PCLOUD_ZOOM_FREQUENCY * M_PI * 2; v = PCLOUD_ZOOM_AMPLITUDE * sin( phase ) * scale; fov_x += v; fov_y += v; diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 378a5305..3a38fc85 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -392,6 +392,14 @@ void Cmd_Give_f( gentity_t *ent ) ent->client->boostedTime = level.time; } } + + if( Q_stricmp( name, "gas" ) == 0 ) + { + ent->client->ps.eFlags |= EF_POISONCLOUDED; + ent->client->lastPoisonCloudedTime = level.time; + trap_SendServerCommand( ent->client->ps.clientNum, + "poisoncloud" ); + } if( give_all || Q_stricmp( name, "ammo" ) == 0 ) { |