From: havoc Date: Mon, 30 Apr 2018 21:59:24 +0000 (+0000) Subject: Fix lighting origins on CSQC entities. X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=b7014e4be0c6c3f4c78867c9db992e8cbccac071 Fix lighting origins on CSQC entities. Fix a couple crashes with showtex 1 on level change where prog is not fully initialized. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12409 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/csprogs.c b/csprogs.c index 6c2d1eff..68dbd839 100644 --- a/csprogs.c +++ b/csprogs.c @@ -349,8 +349,8 @@ qboolean CSQC_AddRenderEdict(prvm_edict_t *ed, int edictnum) // LadyHavoc: use the CL_GetTagMatrix function on self to ensure consistent behavior (duplicate code would be bad) // this also sets the custommodellight_origin for us - VectorCopy(modellight_origin, entrender->custommodellight_origin); CL_GetTagMatrix(prog, &entrender->matrix, ed, 0, modellight_origin); + VectorCopy(modellight_origin, entrender->custommodellight_origin); // set up the animation data VM_GenerateFrameGroupBlend(prog, ed->priv.server->framegroupblend, ed); diff --git a/world.c b/world.c index 60bd0937..c62a83fa 100644 --- a/world.c +++ b/world.c @@ -185,6 +185,10 @@ int World_EntitiesInBox(world_t *world, const vec3_t requestmins, const vec3_t r vec3_t paddedmins, paddedmaxs; int igrid[3], igridmins[3], igridmaxs[3]; + // avoid crash in showtex code on level change + if (prog == NULL || prog->num_edicts < 1) + return 0; + // LordHavoc: discovered this actually causes its own bugs (dm6 teleporters being too close to info_teleport_destination) //VectorSet(paddedmins, requestmins[0] - 1.0f, requestmins[1] - 1.0f, requestmins[2] - 1.0f); //VectorSet(paddedmaxs, requestmaxs[0] + 1.0f, requestmaxs[1] + 1.0f, requestmaxs[2] + 1.0f);