From 6ca8f7d4eb448472ff6d232d80e41d37692e7f59 Mon Sep 17 00:00:00 2001 From: IronClawTrem Date: Sat, 7 Mar 2020 20:33:41 +0000 Subject: sounds for zooming in / out with mass driver --- src/game/bg_public.h | 1 + src/game/g_active.c | 9 +++++++++ 2 files changed, 10 insertions(+) (limited to 'src/game') 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 b5df273..fc7d540 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -582,6 +582,15 @@ 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 ) ) + { + 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 ) -- cgit