From: divverent Date: Wed, 2 Jan 2008 13:48:57 +0000 (+0000) Subject: before calling Mod_CanSeeBox_Trace or TraceLineOfSight, check if the model actually... X-Git-Tag: xonotic-v0.1.0preview~2601 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=00c0a7f03eb62658594f9741c66b2a9407b8b5aa;p=xonotic%2Fdarkplaces.git before calling Mod_CanSeeBox_Trace or TraceLineOfSight, check if the model actually supports them (prevents crash with missing worldmodel) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7894 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_rmain.c b/gl_rmain.c index c01a6885..3e4ec056 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -2214,7 +2214,7 @@ static void R_View_UpdateEntityVisible (void) r_viewcache.entityvisible[i] = !(ent->flags & renderimask) && ((ent->model && ent->model->type == mod_sprite && (ent->model->sprite.sprnum_type == SPR_LABEL || ent->model->sprite.sprnum_type == SPR_LABEL_SCALE)) || !R_CullBox(ent->mins, ent->maxs)) && ((ent->effects & EF_NODEPTHTEST) || (ent->flags & RENDER_VIEWMODEL) || r_refdef.worldmodel->brush.BoxTouchingVisibleLeafs(r_refdef.worldmodel, r_viewcache.world_leafvisible, ent->mins, ent->maxs)); } - if(r_cullentities_trace.integer) + if(r_cullentities_trace.integer && r_refdef.worldmodel->brush.TraceLineOfSight) { for (i = 0;i < r_refdef.numentities;i++) { diff --git a/sv_main.c b/sv_main.c index 8ce2f6d6..53956869 100644 --- a/sv_main.c +++ b/sv_main.c @@ -1263,7 +1263,7 @@ void SV_MarkWriteEntityStateToClient(entity_state_t *s) } // or not seen by random tracelines - if (sv_cullentities_trace.integer && !isbmodel) + if (sv_cullentities_trace.integer && !isbmodel && sv.worldmodel->brush.TraceLineOfSight) { int samples = s->specialvisibilityradius ? sv_cullentities_trace_samples_extra.integer : sv_cullentities_trace_samples.integer; float enlarge = sv_cullentities_trace_enlarge.value;