summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/game')
-rw-r--r--src/game/bg_public.h1
-rw-r--r--src/game/g_active.c10
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 )