fix some OOB enumerator usages

(should be no-op with usual compiler workings)
This commit is contained in:
/dev/humancontroller 2013-04-14 18:33:25 +02:00 committed by Zack Middleton
parent 9e9d6fa52c
commit 120e296a74
5 changed files with 18 additions and 18 deletions

View file

@ -714,10 +714,10 @@ void UI_DrawPlayer( float x, float y, float w, float h, playerInfo_t *pi, int ti
dp_realtime = time;
if ( pi->pendingWeapon != -1 && dp_realtime > pi->weaponTimer ) {
if ( pi->pendingWeapon != WP_NUM_WEAPONS && dp_realtime > pi->weaponTimer ) {
pi->weapon = pi->pendingWeapon;
pi->lastWeapon = pi->pendingWeapon;
pi->pendingWeapon = -1;
pi->pendingWeapon = WP_NUM_WEAPONS;
pi->weaponTimer = 0;
if( pi->currentWeapon != pi->weapon ) {
trap_S_StartLocalSound( weaponChangeSound, CHAN_LOCAL );
@ -1254,7 +1254,7 @@ void UI_PlayerInfo_SetModel( playerInfo_t *pi, const char *model, const char *he
pi->weapon = WP_MACHINEGUN;
pi->currentWeapon = pi->weapon;
pi->lastWeapon = pi->weapon;
pi->pendingWeapon = -1;
pi->pendingWeapon = WP_NUM_WEAPONS;
pi->weaponTimer = 0;
pi->chat = qfalse;
pi->newModel = qtrue;
@ -1293,11 +1293,11 @@ void UI_PlayerInfo_SetInfo( playerInfo_t *pi, int legsAnim, int torsoAnim, vec3_
pi->torso.yawAngle = viewAngles[YAW];
pi->torso.yawing = qfalse;
if ( weaponNumber != -1 ) {
if ( weaponNumber != WP_NUM_WEAPONS ) {
pi->weapon = weaponNumber;
pi->currentWeapon = weaponNumber;
pi->lastWeapon = weaponNumber;
pi->pendingWeapon = -1;
pi->pendingWeapon = WP_NUM_WEAPONS;
pi->weaponTimer = 0;
UI_PlayerInfo_SetWeapon( pi, pi->weapon );
}
@ -1306,8 +1306,8 @@ void UI_PlayerInfo_SetInfo( playerInfo_t *pi, int legsAnim, int torsoAnim, vec3_
}
// weapon
if ( weaponNumber == -1 ) {
pi->pendingWeapon = -1;
if ( weaponNumber == WP_NUM_WEAPONS ) {
pi->pendingWeapon = WP_NUM_WEAPONS;
pi->weaponTimer = 0;
}
else if ( weaponNumber != WP_NONE ) {