- {
- int cb;
- unsigned char *cbcolor;
- e->render.colormap = e->state_current.colormap;
- cb = (e->render.colormap & 0xF) << 4;cb += (cb >= 128 && cb < 224) ? 4 : 12;
- cbcolor = (unsigned char *) (&palette_complete[cb]);
- e->render.colormap_pantscolor[0] = cbcolor[0] * (1.0f / 255.0f);
- e->render.colormap_pantscolor[1] = cbcolor[1] * (1.0f / 255.0f);
- e->render.colormap_pantscolor[2] = cbcolor[2] * (1.0f / 255.0f);
- cb = (e->render.colormap & 0xF0);cb += (cb >= 128 && cb < 224) ? 4 : 12;
- cbcolor = (unsigned char *) (&palette_complete[cb]);
- e->render.colormap_shirtcolor[0] = cbcolor[0] * (1.0f / 255.0f);
- e->render.colormap_shirtcolor[1] = cbcolor[1] * (1.0f / 255.0f);
- e->render.colormap_shirtcolor[2] = cbcolor[2] * (1.0f / 255.0f);
- }
- else if (e->state_current.colormap && cl.scores != NULL)
- {
- int cb;
- unsigned char *cbcolor;
- e->render.colormap = cl.scores[e->state_current.colormap - 1].colors; // color it
- cb = (e->render.colormap & 0xF) << 4;cb += (cb >= 128 && cb < 224) ? 4 : 12;
- cbcolor = (unsigned char *) (&palette_complete[cb]);
- e->render.colormap_pantscolor[0] = cbcolor[0] * (1.0f / 255.0f);
- e->render.colormap_pantscolor[1] = cbcolor[1] * (1.0f / 255.0f);
- e->render.colormap_pantscolor[2] = cbcolor[2] * (1.0f / 255.0f);
- cb = (e->render.colormap & 0xF0);cb += (cb >= 128 && cb < 224) ? 4 : 12;
- cbcolor = (unsigned char *) (&palette_complete[cb]);
- e->render.colormap_shirtcolor[0] = cbcolor[0] * (1.0f / 255.0f);
- e->render.colormap_shirtcolor[1] = cbcolor[1] * (1.0f / 255.0f);
- e->render.colormap_shirtcolor[2] = cbcolor[2] * (1.0f / 255.0f);
- }
+ CL_SetEntityColormapColors(&e->render, e->state_current.colormap);
+ else if (e->state_current.colormap > 0 && e->state_current.colormap <= cl.maxclients && cl.scores != NULL)
+ CL_SetEntityColormapColors(&e->render, cl.scores[e->state_current.colormap-1].colors);