Skip to content

Commit

Permalink
misc loop overrun fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Razish committed Feb 10, 2024
1 parent 540edeb commit 1b32f04
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 56 deletions.
2 changes: 1 addition & 1 deletion code/game/wp_saberLoad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ static void Saber_ParseSaberType( saberInfo_t *saber, const char **p ) {
if ( COM_ParseString( p, &value ) )
return;
saberType = GetIDForString( SaberTable, value );
if ( saberType >= SABER_SINGLE && saberType <= NUM_SABERS )
if ( saberType >= SABER_SINGLE && saberType < NUM_SABERS )
saber->type = (saberType_t)saberType;
}
static void Saber_ParseSaberModel( saberInfo_t *saber, const char **p ) {
Expand Down
2 changes: 1 addition & 1 deletion code/rd-vanilla/tr_surface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@ static void RB_SurfaceBeam( void )
}

qglBegin( GL_TRIANGLE_STRIP );
for ( i = 0; i <= NUM_BEAM_SEGS; i++ ) {
for ( i = 0; i < NUM_BEAM_SEGS; i++ ) {
qglVertex3fv( start_points[ i % NUM_BEAM_SEGS] );
qglVertex3fv( end_points[ i % NUM_BEAM_SEGS] );
}
Expand Down
2 changes: 1 addition & 1 deletion codemp/cgame/cg_draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -3978,7 +3978,7 @@ static float CG_DrawTeamOverlay( float y, qboolean right, qboolean upper ) {
} else {
xx = x + w - TINYCHAR_WIDTH;
}
for (j = 0; j <= PW_NUM_POWERUPS; j++) {
for (j = 0; j < PW_NUM_POWERUPS; j++) {
if (ci->powerups & (1 << j)) {

item = BG_FindItemForPowerup( j );
Expand Down
2 changes: 1 addition & 1 deletion codemp/cgame/cg_newDraw.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ void CG_DrawNewTeamInfo(rectDef_t *rect, float text_x, float text_y, float scale
if ( ci->infoValid && ci->team == cg.snap->ps.persistant[PERS_TEAM]) {

xx = rect->x + 1;
for (j = 0; j <= PW_NUM_POWERUPS; j++) {
for (j = 0; j < PW_NUM_POWERUPS; j++) {
if (ci->powerups & (1 << j)) {

item = BG_FindItemForPowerup( j );
Expand Down
2 changes: 1 addition & 1 deletion codemp/game/NPC_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -2554,7 +2554,7 @@ qboolean NPC_ParseParms( const char *NPCName, gentity_t *NPC )
}
//FIXME: need to precache the weapon, too? (in above func)
weap = GetIDForString( WPTable, value );
if ( weap >= WP_NONE && weap <= WP_NUM_WEAPONS )///*WP_BLASTER_PISTOL*/WP_SABER ) //?!
if ( weap >= WP_NONE && weap < WP_NUM_WEAPONS )///*WP_BLASTER_PISTOL*/WP_SABER ) //?!
{
NPC->client->ps.weapon = weap;
NPC->client->ps.stats[STAT_WEAPONS] |= ( 1 << NPC->client->ps.weapon );
Expand Down
2 changes: 1 addition & 1 deletion codemp/game/bg_saberLoad.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ static void Saber_ParseSaberType( saberInfo_t *saber, const char **p ) {
if ( COM_ParseString( p, &value ) )
return;
saberType = GetIDForString( saberTable, value );
if ( saberType >= SABER_SINGLE && saberType <= NUM_SABERS )
if ( saberType >= SABER_SINGLE && saberType < NUM_SABERS )
saber->type = (saberType_t)saberType;
}
static void Saber_ParseSaberModel( saberInfo_t *saber, const char **p ) {
Expand Down
Loading

0 comments on commit 1b32f04

Please sign in to comment.