]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
particle culling: don't crash if r_refdef.scene.worldmodel is NULL
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 3 Mar 2009 15:13:43 +0000 (15:13 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 3 Mar 2009 15:13:43 +0000 (15:13 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8774 d7cf8633-e32d-0410-b094-e92efae38249

cl_particles.c

index 14d3c498bb4cf4a77a09c76c7b5956accabc2925..67ee07844c7aca41773e4e99c6b9f98db3441c0f 100644 (file)
@@ -617,7 +617,7 @@ void CL_SpawnDecalParticleForSurface(int hitent, const vec3_t org, const vec3_t
        }
        else
        {
-               if(r_refdef.scene.worldmodel->brush.PointInLeaf)
+               if(r_refdef.scene.worldmodel && r_refdef.scene.worldmodel->brush.PointInLeaf)
                {
                        mleaf_t *leaf = r_refdef.scene.worldmodel->brush.PointInLeaf(r_refdef.scene.worldmodel, decal->org);
                        if(leaf)
@@ -2502,7 +2502,7 @@ void R_DrawParticles (void)
                default:
                        if(cl_particles_visculling.integer)
                                if (!r_refdef.viewcache.world_novis)
-                                       if(r_refdef.scene.worldmodel->brush.PointInLeaf)
+                                       if(r_refdef.scene.worldmodel && r_refdef.scene.worldmodel->brush.PointInLeaf)
                                        {
                                                mleaf_t *leaf = r_refdef.scene.worldmodel->brush.PointInLeaf(r_refdef.scene.worldmodel, p->org);
                                                if(leaf)