Skip to content

Commit 5ecbf20

Browse files
committed
Empty lightstyles are fullbright.
1 parent 9e008be commit 5ecbf20

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

src/client/effects.c

+21-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,18 @@ static int cl_lastofs;
4747

4848
void CL_ClearLightStyles(void)
4949
{
50-
memset(cl_lightstyles, 0, sizeof(cl_lightstyles));
50+
int i;
51+
clightstyle_t *ls;
52+
53+
for (i = 0, ls = cl_lightstyles; i < MAX_LIGHTSTYLES; i++, ls++) {
54+
List_Init(&ls->entry);
55+
ls->length = 0;
56+
ls->value[0] =
57+
ls->value[1] =
58+
ls->value[2] =
59+
ls->value[3] = 1;
60+
}
61+
5162
List_Init(&cl_lightlist);
5263
cl_lastofs = -1;
5364
}
@@ -99,11 +110,18 @@ void CL_SetLightStyle(int index, const char *s)
99110
return;
100111
}
101112

113+
if (ls->length == 1) {
114+
ls->value[0] =
115+
ls->value[1] =
116+
ls->value[2] =
117+
ls->value[3] = ls->map[0];
118+
return;
119+
}
120+
102121
ls->value[0] =
103122
ls->value[1] =
104123
ls->value[2] =
105-
ls->value[3] =
106-
ls->map[0] = 1;
124+
ls->value[3] = 1;
107125
}
108126

109127
/*

0 commit comments

Comments
 (0)