void DrawCrosshair(int num)
{
int i;
- byte *color;
+ qbyte *color;
float scale, base;
char *picname;
cachepic_t *pic;
if (num < 0 || num >= NUMCROSSHAIRS)
num = 0;
- if (cl.viewentity)
+ if (cl.viewentity >= 1 && cl.viewentity <= cl.maxclients)
{
i = (cl.scores[cl.viewentity-1].colors & 0xF) << 4;
if (i >= 208 && i < 224) // blue
}
else
i = 15;
- color = (byte *) &d_8to24table[i];
+ color = (qbyte *) &d_8to24table[i];
if (crosshair_flashspeed.value >= 0.01f)
base = (sin(realtime * crosshair_flashspeed.value * (M_PI*2.0f)) * crosshair_flashrange.value);
else