diff --git a/engine/client/pr_csqc.c b/engine/client/pr_csqc.c index f53619a8c..e0c4fd244 100644 --- a/engine/client/pr_csqc.c +++ b/engine/client/pr_csqc.c @@ -4839,7 +4839,7 @@ static void QCBUILTIN PF_getlightstylergb (pubprogfuncs_t *prinst, struct global return; } - if (stnum < cl_max_lightstyles || !cl_lightstyle[stnum].length) + if (stnum >= cl_max_lightstyles || !cl_lightstyle[stnum].length) value = ('m'-'a')*22 * r_lightstylescale.value; else if (cl_lightstyle[stnum].map[0] == '=') value = atof(cl_lightstyle[stnum].map+1)*256*r_lightstylescale.value;