changed brush model API - now uses function pointers for some of the brush model...
[xonotic/darkplaces.git] / cl_particles.c
index 339bdd7..d01333a 100644 (file)
@@ -553,7 +553,7 @@ void CL_ParticleExplosion (vec3_t org)
        if (cl_stainmaps.integer)
                R_Stain(org, 96, 80, 80, 80, 64, 176, 176, 176, 64);
 
-       i = Mod_PointContents(org, cl.worldmodel);
+       i = cl.worldmodel ? cl.worldmodel->PointContents(cl.worldmodel, org) : CONTENTS_EMPTY;
        if ((i == CONTENTS_SLIME || i == CONTENTS_WATER) && cl_particles.integer && cl_particles_bubbles.integer)
        {
                for (i = 0;i < 128;i++)
@@ -992,7 +992,7 @@ void CL_RocketTrail (vec3_t start, vec3_t end, int type, entity_t *ent)
        VectorMA(start, dec, vec, pos);
        len -= dec;
 
-       contents = Mod_PointContents(pos, cl.worldmodel);
+       contents = cl.worldmodel ? cl.worldmodel->PointContents(cl.worldmodel, pos) : CONTENTS_EMPTY;
        if (contents == CONTENTS_SKY || contents == CONTENTS_LAVA)
                return;
 
@@ -1259,7 +1259,7 @@ void CL_MoveParticles (void)
                {
                        f = p->friction * frametime;
                        if (!content)
-                               content = Mod_PointContents(p->org, cl.worldmodel);
+                               content = cl.worldmodel ? cl.worldmodel->PointContents(cl.worldmodel, p->org) : CONTENTS_EMPTY;
                        if (content != CONTENTS_EMPTY)
                                f *= 4;
                        f = 1.0f - f;
@@ -1272,7 +1272,7 @@ void CL_MoveParticles (void)
                        {
                        case pt_blood:
                                if (!content)
-                                       content = Mod_PointContents(p->org, cl.worldmodel);
+                                       content = cl.worldmodel ? cl.worldmodel->PointContents(cl.worldmodel, p->org) : CONTENTS_EMPTY;
                                a = content;
                                if (a != CONTENTS_EMPTY)
                                {
@@ -1290,7 +1290,7 @@ void CL_MoveParticles (void)
                                break;
                        case pt_bubble:
                                if (!content)
-                                       content = Mod_PointContents(p->org, cl.worldmodel);
+                                       content = cl.worldmodel ? cl.worldmodel->PointContents(cl.worldmodel, p->org) : CONTENTS_EMPTY;
                                if (content != CONTENTS_WATER && content != CONTENTS_SLIME)
                                {
                                        p->die = -1;
@@ -1307,7 +1307,7 @@ void CL_MoveParticles (void)
                                        p->vel[2] = /*lhrandom(-32, 32) +*/ p->vel2[2];
                                }
                                if (!content)
-                                       content = Mod_PointContents(p->org, cl.worldmodel);
+                                       content = cl.worldmodel ? cl.worldmodel->PointContents(cl.worldmodel, p->org) : CONTENTS_EMPTY;
                                a = content;
                                if (a != CONTENTS_EMPTY && a != CONTENTS_SKY)
                                        p->die = -1;