diff options
author | tma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2005-11-05 15:54:56 +0000 |
---|---|---|
committer | tma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2005-11-05 15:54:56 +0000 |
commit | 8497c8e83584935876b2b493857b3c0f8feb5721 (patch) | |
tree | 979174546e0cfd27ee67a3409790f19fc7d9e89c /code/cgame | |
parent | 9146f9e36f3689ba29eedafb204c3e956c6ef076 (diff) | |
download | ioquake3-aero-8497c8e83584935876b2b493857b3c0f8feb5721.tar.gz ioquake3-aero-8497c8e83584935876b2b493857b3c0f8feb5721.zip |
* Patch from AJ <anthonyj@planetquake.com> which replaces a bunch of hard coded
constants with #define constants
git-svn-id: svn://svn.icculus.org/quake3/trunk@280 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/cgame')
-rw-r--r-- | code/cgame/cg_weapons.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/code/cgame/cg_weapons.c b/code/cgame/cg_weapons.c index 89af232..d15de2d 100644 --- a/code/cgame/cg_weapons.c +++ b/code/cgame/cg_weapons.c @@ -1489,7 +1489,7 @@ void CG_DrawWeaponSelect( void ) { // count the number of weapons owned bits = cg.snap->ps.stats[ STAT_WEAPONS ]; count = 0; - for ( i = 1 ; i < 16 ; i++ ) { + for ( i = 1 ; i < MAX_WEAPONS ; i++ ) { if ( bits & ( 1 << i ) ) { count++; } @@ -1498,7 +1498,7 @@ void CG_DrawWeaponSelect( void ) { x = 320 - count * 20; y = 380; - for ( i = 1 ; i < 16 ; i++ ) { + for ( i = 1 ; i < MAX_WEAPONS ; i++ ) { if ( !( bits & ( 1 << i ) ) ) { continue; } @@ -1570,9 +1570,9 @@ void CG_NextWeapon_f( void ) { cg.weaponSelectTime = cg.time; original = cg.weaponSelect; - for ( i = 0 ; i < 16 ; i++ ) { + for ( i = 0 ; i < MAX_WEAPONS ; i++ ) { cg.weaponSelect++; - if ( cg.weaponSelect == 16 ) { + if ( cg.weaponSelect == MAX_WEAPONS ) { cg.weaponSelect = 0; } if ( cg.weaponSelect == WP_GAUNTLET ) { @@ -1582,7 +1582,7 @@ void CG_NextWeapon_f( void ) { break; } } - if ( i == 16 ) { + if ( i == MAX_WEAPONS ) { cg.weaponSelect = original; } } @@ -1606,10 +1606,10 @@ void CG_PrevWeapon_f( void ) { cg.weaponSelectTime = cg.time; original = cg.weaponSelect; - for ( i = 0 ; i < 16 ; i++ ) { + for ( i = 0 ; i < MAX_WEAPONS ; i++ ) { cg.weaponSelect--; if ( cg.weaponSelect == -1 ) { - cg.weaponSelect = 15; + cg.weaponSelect = MAX_WEAPONS - 1; } if ( cg.weaponSelect == WP_GAUNTLET ) { continue; // never cycle to gauntlet @@ -1618,7 +1618,7 @@ void CG_PrevWeapon_f( void ) { break; } } - if ( i == 16 ) { + if ( i == MAX_WEAPONS ) { cg.weaponSelect = original; } } @@ -1640,7 +1640,7 @@ void CG_Weapon_f( void ) { num = atoi( CG_Argv( 1 ) ); - if ( num < 1 || num > 15 ) { + if ( num < 1 || num > MAX_WEAPONS-1 ) { return; } @@ -1665,7 +1665,7 @@ void CG_OutOfAmmoChange( void ) { cg.weaponSelectTime = cg.time; - for ( i = 15 ; i > 0 ; i-- ) { + for ( i = MAX_WEAPONS-1 ; i > 0 ; i-- ) { if ( CG_WeaponSelectable( i ) ) { cg.weaponSelect = i; break; |