diff options
author | IronClawTrem <louie.nutman@gmail.com> | 2020-02-21 13:55:46 +0000 |
---|---|---|
committer | IronClawTrem <louie.nutman@gmail.com> | 2020-02-21 13:55:46 +0000 |
commit | 0c097c244fc8c57fa33524c8c351195826519343 (patch) | |
tree | f543b3d6337501afbff9e77a04b115f07d098ba4 /src/game | |
parent | 4410d8e32cf8b4cfefabef9f26943154d39c685b (diff) |
sounds for zooming in / out with mass driver
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/bg_public.h | 1 | ||||
-rw-r--r-- | src/game/g_active.c | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/game/bg_public.h b/src/game/bg_public.h index 462bf95..69967a1 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -280,6 +280,7 @@ typedef enum #define EF_TELEPORT_BIT 0x00000002 // toggled every time the origin abruptly changes #define EF_PLAYER_EVENT 0x00000004 #define EF_BOUNCE 0x00000008 // for missiles +#define EF_ZOOM 0x00000008 #define EF_BOUNCE_HALF 0x00000010 // for missiles #define EF_NO_BOUNCE_SOUND 0x00000020 // for missiles #define EF_WALLCLIMB 0x00000040 // TA: wall walking diff --git a/src/game/g_active.c b/src/game/g_active.c index b9ab899..fcb888a 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -587,6 +587,16 @@ void ClientTimerActions( gentity_t *ent, int msec ) client->time1000 += msec; client->time10000 += msec; + // zoom detection + if( BG_InventoryContainsWeapon( WP_MASS_DRIVER, ent->client->ps.stats ) + || BG_InventoryContainsWeapon( WP_LAS_GUN, ent->client->ps.stats ) ) + { + if( ( ucmd->buttons & BUTTON_ATTACK2 ) && !( ent->client->ps.eFlags & EF_ZOOM ) ) + client->ps.eFlags |= EF_ZOOM; + else if( !( ucmd->buttons & BUTTON_ATTACK2 ) && ( ent->client->ps.eFlags & EF_ZOOM ) ) + client->ps.eFlags &= ~EF_ZOOM; + } + if( aForward == 0 && aRight == 0 ) stopped = qtrue; else if( aForward <= 64 && aRight <= 64 ) |