From: havoc Date: Sun, 26 Sep 2004 02:23:11 +0000 (+0000) Subject: fix R_Shadow_UpdateWorldLight (used by editing commands) to set cubemap even if it... X-Git-Tag: xonotic-v0.1.0preview~5570 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=986bab562b4789959b92d0455fa803621ec1e9f8;p=xonotic%2Fdarkplaces.git 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 --- 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);