From 986bab562b4789959b92d0455fa803621ec1e9f8 Mon Sep 17 00:00:00 2001 From: havoc Date: Sun, 26 Sep 2004 02:23:11 +0000 Subject: [PATCH] fix R_Shadow_UpdateWorldLight (used by editing commands) to set cubemap even if it's an empty string, otherwise it's impossible to remove a cubemap on a light git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4536 d7cf8633-e32d-0410-b094-e92efae38249 --- r_shadow.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/r_shadow.c b/r_shadow.c index 5ff00004..1126cb34 100644 --- a/r_shadow.c +++ b/r_shadow.c @@ -2414,8 +2414,9 @@ void R_Shadow_UpdateWorldLight(dlight_t *light, vec3_t origin, vec3_t angles, ve } light->shadow = shadowenable; light->corona = corona; - if (cubemapname && cubemapname[0] && strlen(cubemapname) < sizeof(light->cubemapname)) - strcpy(light->cubemapname, cubemapname); + if (!cubemapname) + cubemapname = ""; + strlcpy(light->cubemapname, cubemapname, strlen(light->cubemapname)); Matrix4x4_CreateFromQuakeEntity(&light->matrix, light->origin[0], light->origin[1], light->origin[2], light->angles[0], light->angles[1], light->angles[2], 1); R_RTLight_UpdateFromDLight(&light->rtlight, light, true); -- 2.39.2