diff options
author | Tim Angus <tim@ngus.net> | 2001-05-07 16:09:41 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2001-05-07 16:09:41 +0000 |
commit | c24682b923c47083bfd83c7fd929f162c5b24f3b (patch) | |
tree | 022305dfb436b265bf092f81882d2da2732131e1 /src/cgame | |
parent | 63c14b02a7f7e44c5ee99a999bc0477cded7cb9a (diff) |
No weapon handled better.
Diffstat (limited to 'src/cgame')
-rw-r--r-- | src/cgame/cg_draw.c | 16 | ||||
-rw-r--r-- | src/cgame/cg_playerstate.c | 3 | ||||
-rw-r--r-- | src/cgame/cg_weapons.c | 26 |
3 files changed, 32 insertions, 13 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index 1c2067ca..a265a329 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -2119,19 +2119,21 @@ static void CG_DrawAmmoWarning( void ) { const char *s; int w; - if ( cg_drawAmmoWarning.integer == 0 ) { + //TA: hack + if( cg.snap->ps.weapon == WP_NONE ) + return; + + if ( cg_drawAmmoWarning.integer == 0 ) return; - } - if ( !cg.lowAmmoWarning ) { + if ( !cg.lowAmmoWarning ) return; - } - if ( cg.lowAmmoWarning == 2 ) { + if ( cg.lowAmmoWarning == 2 ) s = "OUT OF AMMO"; - } else { + else s = "LOW AMMO WARNING"; - } + w = CG_DrawStrlen( s ) * BIGCHAR_WIDTH; CG_DrawBigString(320 - w / 2, 64, s, 1.0F); } diff --git a/src/cgame/cg_playerstate.c b/src/cgame/cg_playerstate.c index 76e196a0..05c8805f 100644 --- a/src/cgame/cg_playerstate.c +++ b/src/cgame/cg_playerstate.c @@ -66,7 +66,8 @@ void CG_CheckAmmo( void ) { total += ammo * 200; break; } - if ( total >= 5000 || BG_infiniteAmmo( i ) ) { + if ( total >= 5000 || BG_infiniteAmmo( i ) ) + { cg.lowAmmoWarning = 0; return; } diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c index 318e227a..a6997290 100644 --- a/src/cgame/cg_weapons.c +++ b/src/cgame/cg_weapons.c @@ -934,7 +934,8 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent gun.renderfx = parent->renderfx; // set custom shading for railgun refire rate - if ( ps ) { + if ( ps ) + { if ( cg.predictedPlayerState.weapon == WP_RAILGUN && cg.predictedPlayerState.weaponstate == WEAPON_FIRING ) { float f; @@ -1075,6 +1076,10 @@ void CG_AddViewWeapon( playerState_t *ps ) { return; } + //TA: no weapon carried - can't draw it + if( ps->weapon == WP_NONE ) + return; + if ( ps->pm_type == PM_INTERMISSION ) { return; } @@ -1235,13 +1240,22 @@ void CG_DrawWeaponSelect( void ) { y += 20; } + + //TA: yuck! :) + if( y == 10 ) + { + trap_R_SetColor( NULL ); + return; + } // draw the selected name if( cg.weaponSelect <= 32 ) { - if ( cg_weapons[ cg.weaponSelect ].item ) { + if ( cg_weapons[ cg.weaponSelect ].item ) + { name = cg_weapons[ cg.weaponSelect ].item->pickup_name; - if ( name ) { + if ( name ) + { w = CG_DrawStrlen( name ) * BIGCHAR_WIDTH; x = ( SCREEN_WIDTH - w ) / 2; CG_DrawBigStringColor(x, y - 22, name, color); @@ -1250,9 +1264,11 @@ void CG_DrawWeaponSelect( void ) { } else if( cg.weaponSelect > 32 ) { - if ( cg_upgrades[ cg.weaponSelect - 32 ].item ) { + if ( cg_upgrades[ cg.weaponSelect - 32 ].item ) + { name = cg_upgrades[ cg.weaponSelect - 32 ].item->pickup_name; - if ( name ) { + if ( name ) + { w = CG_DrawStrlen( name ) * BIGCHAR_WIDTH; x = ( SCREEN_WIDTH - w ) / 2; CG_DrawBigStringColor(x, y - 22, name, color); |