Navigation Menu

Skip to content

Commit

Permalink
Allow disabling alien 1st person chompers/choppers.
Browse files Browse the repository at this point in the history
cg_drawGun's behavior has been modified as follows:
    cg_drawGun 0 -> draw no 1st person weapons
    cg_drawGun 1 -> draw only human 1st person weapons
    cg_drawGun 2 -> draw both alien and human 1st person weapons
  • Loading branch information
DolceTriade committed Aug 29, 2012
1 parent 0682e1c commit df44c83
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/gamelogic/cgame/cg_weapons.c
Expand Up @@ -1740,6 +1740,7 @@ void CG_AddViewWeapon( playerState_t *ps )
weaponInfo_t *wi;
weapon_t weapon = ps->weapon;
weaponMode_t weaponMode = ps->generic1;
qboolean drawGun = qtrue;

// no weapon carried - can't draw it
if ( weapon == WP_NONE )
Expand All @@ -1754,6 +1755,21 @@ void CG_AddViewWeapon( playerState_t *ps )

wi = &cg_weapons[ weapon ];

switch ( cg_drawGun.integer )
{
case 0:
drawGun = qfalse;
break;

case 1:
if ( BG_Weapon( weapon )->team == TEAM_ALIENS )
{
drawGun = qfalse;
}
break;
}


if ( !wi->registered )
{
Com_Printf( _( S_COLOR_YELLOW "WARNING: CG_AddViewWeapon: weapon %d (%s) "
Expand Down Expand Up @@ -1786,7 +1802,7 @@ void CG_AddViewWeapon( playerState_t *ps )
}

// allow the gun to be completely removed
if ( !cg_drawGun.integer )
if ( !drawGun )
{
vec3_t origin;

Expand Down

0 comments on commit df44c83

Please sign in to comment.