]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - r_crosshairs.c
MOVETYPE_STEP entities should now fall when support is removed (even if it is not...
[xonotic/darkplaces.git] / r_crosshairs.c
index 46585f980edbc0adcf6e9d46e24bd3f47cfba121..83a45ecb74717ee2e92009de48a17a824111810a 100644 (file)
@@ -21,13 +21,13 @@ void R_Crosshairs_Init(void)
 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
@@ -37,7 +37,7 @@ void DrawCrosshair(int num)
        }
        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