]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
DODGING: Check if swimming. If so, don't allow dodging
authorFlorian Paul Schmidt <mista.tapas@gmx.net>
Mon, 29 Mar 2010 23:03:21 +0000 (01:03 +0200)
committerFlorian Paul Schmidt <mista.tapas@gmx.net>
Mon, 29 Mar 2010 23:03:21 +0000 (01:03 +0200)
qcsrc/server/mutators/mutator_dodging.qc

index ba8e021eab6c38c18e0a685158c099dc9695558d..62caadc1b9fe2873dd9cf15bad559bf9a0413cf9 100644 (file)
@@ -46,10 +46,15 @@ MUTATOR_HOOKFUNCTION(dodging_PlayerPhysics) {
 
        float common_factor;
 
-       // is dodging enabled at all? if not, do nothing..
        if (g_dodging == 0)
                return 0;
 
+       // when swimming, no dodging allowed..
+       if (self.waterlevel >= WATERLEVEL_SWIMMING) {
+               self.dodging_action = 0;
+               return 0;
+       }
+
        // make sure v_up, v_right and v_forward are sane
        makevectors(self.angles);