Fix hl2bsp static props with r_ignoreentpvs 0.
This commit is contained in:
parent
42148878aa
commit
5392900887
|
@ -3422,6 +3422,16 @@ void CL_LinkStaticEntities(void *pvs, int *areas)
|
|||
}
|
||||
if (!src->light_known)
|
||||
R_CalcModelLighting(src, src->model); //bake and cache, now everything else is working.
|
||||
if (src->pvscache.num_leafs==-2)
|
||||
{
|
||||
vec3_t absmin, absmax;
|
||||
float r = src->model->radius;
|
||||
VectorSet(absmin, -r,-r,-r);
|
||||
VectorSet(absmax, r,r,r);
|
||||
VectorAdd(absmin, src->origin, absmin);
|
||||
VectorAdd(absmax, src->origin, absmax);
|
||||
cl.worldmodel->funcs.FindTouchedLeafs(cl.worldmodel, &src->pvscache, absmin, absmax);
|
||||
}
|
||||
|
||||
ent = &cl_visedicts[cl_numvisedicts++];
|
||||
*ent = *src;
|
||||
|
|
|
@ -5631,6 +5631,8 @@ static qboolean CModHL2_LoadStaticProps(model_t *mod, qbyte *offset, size_t size
|
|||
ent->model = Mod_FindName(modelref[modelindex].name);
|
||||
AngleVectorsFLU(ent->angles, ent->axis[0], ent->axis[1], ent->axis[2]);
|
||||
|
||||
//Hack: special value to flag it for linking once we've loaded its model. this needs to go when we make them solid.
|
||||
ent->pvscache.num_leafs = -2;
|
||||
//Hack: lighting is wrong.
|
||||
ent->light_known = 1;
|
||||
VectorSet(ent->light_dir, 0, 0.707, 0.707);
|
||||
|
|
|
@ -525,6 +525,7 @@ qboolean QDECL Mod_LoadHL2Model (model_t *mod, const void *buffer, size_t fsize)
|
|||
|
||||
VectorCopy(header->mins, mod->mins);
|
||||
VectorCopy(header->maxs, mod->maxs);
|
||||
mod->radius = RadiusFromBounds(mod->mins, mod->maxs);
|
||||
|
||||
mod->type = mod_alias;
|
||||
return result;
|
||||
|
|
Loading…
Reference in New Issue