diff options
author | IronClawTrem <louie.nutman@gmail.com> | 2020-03-07 20:33:41 +0000 |
---|---|---|
committer | IronClawTrem <louie.nutman@gmail.com> | 2020-03-07 20:37:30 +0000 |
commit | 6ca8f7d4eb448472ff6d232d80e41d37692e7f59 (patch) | |
tree | 2216ed20900a0f99951518b1677d034f06416d54 /src/game | |
parent | a359e7b9d929f3f18c24aacd78d5882f923a0680 (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 | 9 |
2 files changed, 10 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 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 ) |