Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Shared] misc loop overrun fixes #1201

Merged
merged 3 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 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