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

@ -708,10 +708,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 );
@ -1136,7 +1136,7 @@ void UI_PlayerInfo_SetModel( playerInfo_t *pi, const char *model ) {
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;
@ -1202,11 +1202,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 );
}
@ -1215,8 +1215,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 ) {

View File

@ -1398,7 +1398,7 @@ Return the searchpath in "startSearch".
=================
*/
vmInterpret_t FS_FindVM(void **startSearch, char *found, int foundlen, const char *name, int enableDll)
int FS_FindVM(void **startSearch, char *found, int foundlen, const char *name, int enableDll)
{
searchpath_t *search, *lastSearch;
directory_t *dir;

View File

@ -624,7 +624,7 @@ qboolean FS_FileExists( const char *file );
qboolean FS_CreatePath (char *OSPath);
vmInterpret_t FS_FindVM(void **startSearch, char *found, int foundlen, const char *name, int enableDll);
int FS_FindVM(void **startSearch, char *found, int foundlen, const char *name, int enableDll);
char *FS_BuildOSPath( const char *base, const char *game, const char *qpath );
qboolean FS_CompareZipChecksum(const char *zipfile);

View File

@ -118,7 +118,7 @@ static void UI_StartServerRefresh(qboolean full);
static void UI_StopServerRefresh( void );
static void UI_DoServerRefresh( void );
static void UI_FeederSelection(float feederID, int index);
static void UI_BuildServerDisplayList(qboolean force);
static void UI_BuildServerDisplayList(int force);
static void UI_BuildServerStatus(qboolean force);
static void UI_BuildFindPlayerList(qboolean force);
static int QDECL UI_ServersQsortCompare( const void *arg1, const void *arg2 );
@ -3762,7 +3762,7 @@ static void UI_BinaryServerInsertion(int num) {
UI_BuildServerDisplayList
==================
*/
static void UI_BuildServerDisplayList(qboolean force) {
static void UI_BuildServerDisplayList(int force) {
int i, count, clients, maxClients, ping, game, len, visible;
char info[MAX_STRING_CHARS];
// qboolean startRefresh = qtrue; TTimo: unused

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 ) {