]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Make corpses sink slowly in water
authorMario <zacjardine@y7mail.com>
Thu, 9 Jul 2015 03:28:32 +0000 (13:28 +1000)
committerMario <zacjardine@y7mail.com>
Thu, 9 Jul 2015 03:28:32 +0000 (13:28 +1000)
qcsrc/common/physics.qc

index ea217c5a1877fce7f59ad2f3585f2f6799767858..410c27131f434abd92cb81b037b3c2c710f18cca 100644 (file)
@@ -1754,7 +1754,19 @@ void PM_Main()
 #endif
 
        if(PHYS_DEAD(self))
+       {
+               // handle water here
+               vector midpoint = ((self.absmin + self.absmax) * 0.5);
+               if(pointcontents(midpoint) == CONTENT_WATER)
+               {
+                       self.velocity = self.velocity * 0.5;
+
+                       // do we want this?
+                       //if(pointcontents(midpoint + '0 0 2') == CONTENT_WATER)
+                               //{ self.velocity_z = 70; }
+               }
                goto end;
+       }
 
 #ifdef SVQC
        if (!self.fixangle && !g_bugrigs)