Skip to content

Commit

Permalink
ref: a bit more verbosity if UserTracer color exceed limit
Browse files Browse the repository at this point in the history
  • Loading branch information
a1batross committed May 27, 2023
1 parent 3a57f26 commit d994c6d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ref/gl/gl_rpart.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,9 @@ void CL_DrawTracers( double frametime, particle_t *cl_active_tracers )
VectorAdd( verts[0], delta, verts[2] );
VectorAdd( verts[1], delta, verts[3] );

if( p->color > sizeof( gTracerColors ) / sizeof( color24 ) )
if( p->color > sizeof( gTracerColors ) / sizeof( gTracerColors[0] ))
{
gEngfuncs.Con_Printf( S_ERROR "UserTracer with color > %d\n", sizeof( gTracerColors ) / sizeof( color24 ));
gEngfuncs.Con_Printf( S_ERROR "UserTracer with color(%d) > %d\n", p->color, sizeof( gTracerColors ) / sizeof( gTracerColors[0] ));
p->color = 0;
}

Expand Down
4 changes: 2 additions & 2 deletions ref/soft/r_part.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,9 @@ void GAME_EXPORT CL_DrawTracers( double frametime, particle_t *cl_active_tracers
VectorAdd( verts[0], delta, verts[2] );
VectorAdd( verts[1], delta, verts[3] );

if( p->color > sizeof( gTracerColors ) / sizeof( color24 ) )
if( p->color > sizeof( gTracerColors ) / sizeof( gTracerColors[0] ))
{
gEngfuncs.Con_Printf( S_ERROR "UserTracer with color > %d\n", sizeof( gTracerColors ) / sizeof( color24 ));
gEngfuncs.Con_Printf( S_ERROR "UserTracer with color(%d) > %d\n", p->color, sizeof( gTracerColors ) / sizeof( gTracerColors[0] ));
p->color = 0;
}

Expand Down

0 comments on commit d994c6d

Please sign in to comment.