diff options
| -rw-r--r-- | src/cgame/cg_servercmds.c | 5 | ||||
| -rw-r--r-- | src/game/bg_pmove.c | 28 | ||||
| -rw-r--r-- | src/game/bg_public.h | 3 | ||||
| -rw-r--r-- | src/game/g_cmds.c | 38 | ||||
| -rw-r--r-- | src/game/g_local.h | 2 | ||||
| -rw-r--r-- | src/game/g_weapon.c | 3 | 
6 files changed, 43 insertions, 36 deletions
diff --git a/src/cgame/cg_servercmds.c b/src/cgame/cg_servercmds.c index f95d18b7..8de4e198 100644 --- a/src/cgame/cg_servercmds.c +++ b/src/cgame/cg_servercmds.c @@ -548,6 +548,11 @@ void CG_Menu( int menu, int arg )        type      = DT_COMMAND;        break; +    case MN_CMD_CHEAT_TEAM: +      shortMsg  = "You may not use this command while on a team"; +      type      = DT_COMMAND; +      break; +      case MN_CMD_TEAM:        //longMsg   = "You must be on a team to perform this action. Join the alien"        //            "or human team and try again."; diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index 6f15674c..7f62fd14 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -2835,9 +2835,9 @@ static void PM_Weapon( void )  {    int           addTime = 200; //default addTime - should never be used    int           maxClips; -  qboolean      attack1 = qfalse; -  qboolean      attack2 = qfalse; -  qboolean      attack3 = qfalse; +  qboolean      attack1 = pm->cmd.buttons & BUTTON_ATTACK; +  qboolean      attack2 = pm->cmd.buttons & BUTTON_ATTACK2; +  qboolean      attack3 = pm->cmd.buttons & BUTTON_USE_HOLDABLE;    // Ignore weapons in some cases    if( pm->ps->persistant[ PERS_SPECSTATE ] != SPECTATOR_NOT || @@ -3054,11 +3054,9 @@ static void PM_Weapon( void )    // check for out of ammo    if( !pm->ps->ammo && !pm->ps->clips && !BG_Weapon( pm->ps->weapon )->infiniteAmmo )    { -    if( ( pm->cmd.buttons & BUTTON_ATTACK ) || -        ( BG_Weapon( pm->ps->weapon )->hasAltMode && -          ( pm->cmd.buttons & BUTTON_ATTACK2 ) ) || -        ( BG_Weapon( pm->ps->weapon )->hasThirdMode && -          ( pm->cmd.buttons & BUTTON_USE_HOLDABLE ) ) ) +    if( attack1 || +        ( BG_Weapon( pm->ps->weapon )->hasAltMode && attack2 ) || +        ( BG_Weapon( pm->ps->weapon )->hasThirdMode && attack3 ) )      {        PM_AddEvent( EV_NOAMMO );        pm->ps->weaponTime += 500; @@ -3115,18 +3113,13 @@ static void PM_Weapon( void )      case WP_ALEVEL3:      case WP_ALEVEL3_UPG:        //pouncing has primary secondary AND autohit procedures -      attack1 = pm->cmd.buttons & BUTTON_ATTACK; -      attack2 = pm->cmd.buttons & BUTTON_ATTACK2; -      attack3 = pm->cmd.buttons & BUTTON_USE_HOLDABLE; -        // pounce is autohit        if( !attack1 && !attack2 && !attack3 )          return;        break;      case WP_LUCIFER_CANNON: -      attack1 = pm->cmd.buttons & BUTTON_ATTACK; -      attack2 = pm->cmd.buttons & BUTTON_ATTACK2; +      attack3 = qfalse;        // Prevent firing of the Lucifer Cannon after an overcharge        if( pm->ps->weaponstate == WEAPON_NEEDS_RESET ) @@ -3179,7 +3172,7 @@ static void PM_Weapon( void )        break;      case WP_MASS_DRIVER: -      attack1 = pm->cmd.buttons & BUTTON_ATTACK; +      attack2 = attack3 = qfalse;        // attack2 is handled on the client for zooming (cg_view.c)        if( !attack1 ) @@ -3191,11 +3184,6 @@ static void PM_Weapon( void )        break;      default: -      //by default primary and secondary attacks are allowed -      attack1 = pm->cmd.buttons & BUTTON_ATTACK; -      attack2 = pm->cmd.buttons & BUTTON_ATTACK2; -      attack3 = pm->cmd.buttons & BUTTON_USE_HOLDABLE; -        if( !attack1 && !attack2 && !attack3 )        {          pm->ps->weaponTime = 0; diff --git a/src/game/bg_public.h b/src/game/bg_public.h index 5763c658..a08b8cdd 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -113,7 +113,7 @@ typedef enum    PM_GRABBED,       // like dead, but for when the player is still live    PM_DEAD,          // no acceleration or turning, but free falling    PM_FREEZE,        // stuck in place with no control -  PM_INTERMISSION,  // no movement or status bar +  PM_INTERMISSION   // no movement or status bar  } pmtype_t;  // pmtype_t categories @@ -554,6 +554,7 @@ typedef enum    // cmd stuff    MN_CMD_CHEAT, +  MN_CMD_CHEAT_TEAM,    MN_CMD_TEAM,    MN_CMD_SPEC,    MN_CMD_ALIEN, diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 06d2ed81..c12afd4a 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -1760,12 +1760,12 @@ void Cmd_Destroy_f( gentity_t *ent )        ( ( ent->client->ps.weapon >= WP_ABUILD ) &&          ( ent->client->ps.weapon <= WP_HBUILD ) ) )    { -      // Always let the builder prevent the explosion  -      if( traceEnt->health <= 0 ) -      { -        G_FreeEntity( traceEnt ); -        return; -      } +    // Always let the builder prevent the explosion  +    if( traceEnt->health <= 0 ) +    { +      G_FreeEntity( traceEnt ); +      return; +    }      // Cancel deconstruction      if( g_markDeconstruct.integer && traceEnt->deconstruct ) @@ -1781,19 +1781,19 @@ void Cmd_Destroy_f( gentity_t *ent )            traceEnt->s.modelindex == BA_A_SPAWN )        {          if( level.numAlienSpawns <= 1 ) -          { -            G_TriggerMenu( ent->client->ps.clientNum, MN_B_LASTSPAWN ); +        { +          G_TriggerMenu( ent->client->ps.clientNum, MN_B_LASTSPAWN );            return; -          } +        }        }        else if( ent->client->pers.teamSelection == TEAM_HUMANS &&                 traceEnt->s.modelindex == BA_H_SPAWN )        {          if( level.numHumanSpawns <= 1 ) -          { -            G_TriggerMenu( ent->client->ps.clientNum, MN_B_LASTSPAWN ); +        { +          G_TriggerMenu( ent->client->ps.clientNum, MN_B_LASTSPAWN );            return; -          } +        }        }      } @@ -1811,10 +1811,13 @@ void Cmd_Destroy_f( gentity_t *ent )        return;      } -    if( g_markDeconstruct.integer ) +    if( traceEnt->health > 0 )      {        if( !deconstruct ) -          G_Damage( traceEnt, ent, ent, forward, tr.endpos, ent->health, 0, MOD_SUICIDE ); +      { +        G_Damage( traceEnt, ent, ent, forward, tr.endpos, +                  traceEnt->health, 0, MOD_SUICIDE ); +      }        else if( g_markDeconstruct.integer )        {          traceEnt->deconstruct     = qtrue; // Mark buildable for deconstruction @@ -3061,6 +3064,13 @@ void ClientCommand( int clientNum )      return;    } +  if( cmds[ i ].cmdFlags & CMD_CHEAT_TEAM && !g_cheats.integer && +      ent->client->pers.teamSelection != TEAM_NONE ) +  { +    G_TriggerMenu( clientNum, MN_CMD_CHEAT_TEAM ); +    return; +  } +    if( cmds[ i ].cmdFlags & CMD_SPEC &&        ent->client->sess.spectatorState == SPECTATOR_NOT )    { diff --git a/src/game/g_local.h b/src/game/g_local.h index f1fa6b11..56985299 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -642,7 +642,7 @@ typedef struct  #define CMD_CHEAT_TEAM    0x0002 // is a cheat when used on a team  #define CMD_MESSAGE       0x0004 // sends message to others (skip when muted)  #define CMD_TEAM          0x0008 // must be on a team -#define CMD_SPEC          0x0010 // must be in spectator mode +#define CMD_SPEC          0x0010 // must be a spectator  #define CMD_ALIEN         0x0020  #define CMD_HUMAN         0x0040  #define CMD_LIVING        0x0080 diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index 13648267..d5eda5ab 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -923,6 +923,9 @@ qboolean CheckVenomAttack( gentity_t *ent )    if( traceEnt->health <= 0 )        return qfalse; +  if( traceEnt->health <= 0 ) +      return qfalse; +    if( !traceEnt->client && !traceEnt->s.eType == ET_BUILDABLE )      return qfalse;  | 
