diff options
author | Tim Angus <tim@ngus.net> | 2001-01-15 04:06:42 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2001-01-15 04:06:42 +0000 |
commit | 64806bda9892ce84e0b5e11ce5e5f9052c1183b3 (patch) | |
tree | b3e6b5c05c901b13031710c4d28cf21baae71b3b /src/game/g_active.c | |
parent | dfa6ae440ddddaaf22e4b32dbc6d31b13e162d4d (diff) |
Half-done revamping defmenus; bug fixes;MCU
Diffstat (limited to 'src/game/g_active.c')
-rw-r--r-- | src/game/g_active.c | 31 |
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 |