summaryrefslogtreecommitdiff
path: root/src/game/g_active.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/g_active.c')
-rw-r--r--src/game/g_active.c31
1 files changed, 26 insertions, 5 deletions
diff --git a/src/game/g_active.c b/src/game/g_active.c
index b6c7d41b..e4a1ffbf 100644
--- a/src/game/g_active.c
+++ b/src/game/g_active.c
@@ -356,7 +356,7 @@ void SpectatorThink( gentity_t *ent, usercmd_t *ucmd ) {
client->oldbuttons = client->buttons;
client->buttons = ucmd->buttons;
- if ( ( client->buttons & BUTTON_ATTACK ) && !( client->oldbuttons & BUTTON_ATTACK ) )
+ if( ( client->buttons & BUTTON_ATTACK ) && !( client->oldbuttons & BUTTON_ATTACK ) )
{
if( client->pers.pteam == PTE_NONE )
{
@@ -371,13 +371,13 @@ void SpectatorThink( gentity_t *ent, usercmd_t *ucmd ) {
G_AddPredictableEvent( ent, EV_MENU, MN_HUMAN );
}
}
-
+
// attack button cycles through spectators
//TA: messes with the menus
- /*if ( ( client->buttons & BUTTON_ATTACK ) &&
+ if ( ( client->buttons & BUTTON_ATTACK ) &&
!( client->oldbuttons & BUTTON_ATTACK ) &&
- ( client->sess.spectatorState != SPECTATOR_LOCKED ) )
- Cmd_FollowCycle_f( ent, 1 );*/
+ ( client->sess.spectatorState == SPECTATOR_FREE ) )
+ Cmd_FollowCycle_f( ent, 1 );
}
@@ -882,6 +882,27 @@ void ClientThink_real( gentity_t *ent ) {
client->buttons = ucmd->buttons;
client->latched_buttons |= client->buttons & ~client->oldbuttons;
+ //TA: look for MCU infront of player
+ if( ( client->buttons & BUTTON_GETFLAG ) && !( client->oldbuttons & BUTTON_GETFLAG ) )
+ {
+ if( client->pers.pteam == PTE_HUMANS )
+ {
+ trace_t mcu;
+ vec3_t view, point;
+ gentity_t *mcuEntity;
+
+ AngleVectors( client->ps.viewangles, view, NULL, NULL );
+ VectorMA( client->ps.origin, 200, view, point );
+ trap_Trace( &mcu, client->ps.origin, NULL, NULL, point, ent->s.number, MASK_SHOT );
+
+ mcuEntity = &g_entities[ mcu.entityNum ];
+
+ //bring up a menu if its there
+ if( !Q_stricmp( mcuEntity->classname, "team_human_mcu" ) )
+ G_AddPredictableEvent( ent, EV_MENU, MN_MCU );
+ }
+ }
+
// check for respawning
if ( client->ps.stats[STAT_HEALTH] <= 0 ) {
// wait for the attack button to be pressed