make the shooting star death available outside of debug
authorMrBougo <mrbougo@xonotic.org>
Fri, 9 Jul 2010 18:27:51 +0000 (20:27 +0200)
committerMrBougo <mrbougo@xonotic.org>
Fri, 9 Jul 2010 18:27:51 +0000 (20:27 +0200)
new cvar: g_maxspeed, 0 default (no limits), any player who goes faster gets killed

defaultXonotic.cfg
qcsrc/server/sv_main.qc

index 307f58fa78b76005964d1a54f514d599d9baac6a..19fe9fef501474f09ddbd1450be10692d2196a65 100644 (file)
@@ -1847,3 +1847,5 @@ set g_weaponreplace_seeker ""
 set sv_q3acompat_machineshotgunswap 0 "shorthand for swapping uzi and shotgun (for Q3A map compatibility in mapinfo files)"
 
 set g_movement_highspeed 1 "movement speed modification factor (only changes movement when above maxspeed)"
+
+set g_maxspeed 0 "player speed limit, faster players are killed (0 for unlimited speed)"
index 45320f2db526f0303cb0f3e9d8aed3181e78c9e7..a79f9a473b0638911a9918f2ec78513eab9a0cca 100644 (file)
@@ -2,7 +2,7 @@
 void CreatureFrame (void)
 {
        local entity oldself;
-       local float dm;
+       local float dm, maxspeed;
        oldself = self;
        self = findfloat(world, iscreature, TRUE);
        while (self)
@@ -78,13 +78,12 @@ void CreatureFrame (void)
                                {
                                        Damage (self, world, world, dm, DEATH_FALL, self.origin, '0 0 0');
                                }
-                               else if(vlen(self.velocity) > 100000 && cvar("developer"))
-                               {
-                                       dprint(strcat(self.netname, " became too fast, please investigate: ", vtos(self.spawnorigin), "\n"));
-                                       Damage (self, world, world, 50000, DEATH_SHOOTING_STAR, self.origin, '0 0 0');
-                               }
                        }
 
+                       maxspeed = cvar("g_maxspeed");
+                       if(maxspeed > 0 && vlen(self.velocity) > maxspeed)
+                               Damage (self, world, world, 100000, DEATH_SHOOTING_STAR, self.origin, '0 0 0');
+
                        // play stupid sounds
                        if (g_footsteps)
                        if (!gameover)