]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/sv_main.qc
Merge branch 'master' into Mario/monsters
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / sv_main.qc
index 424b124f561fd9433b82c66ac9b5ade70696d52d..93f32dcdd7224224c752a0a11081b17d34559059 100644 (file)
@@ -10,6 +10,7 @@ void CreatureFrame (void)
                
                float vehic = (self.vehicle_flags & VHF_ISVEHICLE);
                float projectile = (self.flags & FL_PROJECTILE);
+               float monster = (self.flags & FL_MONSTER);
                
                if (self.watertype <= CONTENT_WATER && self.waterlevel > 0) // workaround a retarded bug made by id software :P (yes, it's that old of a bug)
                {
@@ -19,7 +20,7 @@ void CreatureFrame (void)
                                self.dmgtime = 0;
                        }
 
-                       if(!vehic && !projectile) // vehicles and projectiles don't drown
+                       if(!vehic && !projectile && !monster) // vehicles, monsters and projectiles don't drown
                        {
                                if (self.waterlevel != WATERLEVEL_SUBMERGED)
                                {
@@ -106,6 +107,34 @@ void CreatureFrame (void)
 
                        if(autocvar_g_maxspeed > 0 && velocity_len > autocvar_g_maxspeed)
                                Damage (self, world, world, 100000, DEATH_SHOOTING_STAR, self.origin, '0 0 0');
+                       // play stupid sounds
+                       if (g_footsteps)
+                       if (!gameover)
+                       if (self.flags & FL_ONGROUND)
+                       if (velocity_len > autocvar_sv_maxspeed * 0.6)
+                       if (!self.deadflag)
+                       if (time < self.lastground + 0.2)
+                       {
+                               if((time > self.nextstep) || (time < (self.nextstep - 10.0)))
+                               {
+                                       self.nextstep = time + 0.3 + random() * 0.1;
+                                       trace_dphitq3surfaceflags = 0;
+                                       tracebox(self.origin, self.mins, self.maxs, self.origin - '0 0 1', MOVE_NOMONSTERS, self);
+                                       /*
+                                       if(trace_fraction == 1)
+                                               dprint("nohit\n");
+                                       else
+                                               dprint(ftos(trace_dphitq3surfaceflags), "\n");
+                                       */
+                                       if not(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOSTEPS)
+                                       {
+                                               if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_METALSTEPS)
+                                                       GlobalSound(globalsound_metalstep, CH_PLAYER, VOICETYPE_PLAYERSOUND);
+                                               else
+                                                       GlobalSound(globalsound_step, CH_PLAYER, VOICETYPE_PLAYERSOUND);
+                                       }
+                               }
+                       }
                }
                
         self.oldvelocity = self.velocity;