]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/mutator_multijump.qc
Merge master into qc_physics_prehax (blame TimePath if it's completely broken)
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator_multijump.qc
index bb60cc9bd9de080f0c7dd347f918771ea707bdc4..dd879e5de4bc4858c3bf19c14c0f561843c13b0d 100644 (file)
@@ -1,3 +1,9 @@
+#ifdef SVQC
+       #include "../_all.qh"
+       #include "mutator.qh"
+       #include "../antilag.qh"
+#endif
+
 .float multijump_count;
 .float multijump_ready;
 
@@ -46,12 +52,12 @@ void PM_multijump()
 
 float PM_multijump_checkjump()
 {
-       if(!PHYS_MULTIJUMP) { return FALSE; }
+       if(!PHYS_MULTIJUMP) { return false; }
 
        if (!IS_JUMP_HELD(self) && !IS_ONGROUND(self)) // jump button pressed this frame and we are in midair
-               self.multijump_ready = TRUE;  // this is necessary to check that we released the jump button and pressed it again
+               self.multijump_ready = true;  // this is necessary to check that we released the jump button and pressed it again
        else
-               self.multijump_ready = FALSE;
+               self.multijump_ready = false;
 
        if(!player_multijump && self.multijump_ready && (self.multijump_count < PHYS_MULTIJUMP || PHYS_MULTIJUMP == -1) && self.velocity_z > PHYS_MULTIJUMP_SPEED)
        {
@@ -61,16 +67,16 @@ float PM_multijump_checkjump()
                        {
                                if (self.velocity_z < PHYS_JUMPVELOCITY)
                                {
-                                       player_multijump = TRUE;
+                                       player_multijump = true;
                                        self.velocity_z = 0;
                                }
                        }
                        else
-                               player_multijump = TRUE;
+                               player_multijump = true;
 
                        if(player_multijump)
                        {
-                               if(PHYS_INPUT_MOVEVALUES(self)_x != 0 || PHYS_INPUT_MOVEVALUES(self)_y != 0) // don't remove all speed if player isnt pressing any movement keys
+                               if(self.movement_x != 0 || self.movement_y != 0) // don't remove all speed if player isnt pressing any movement keys
                                {
                                        float curspeed;
                                        vector wishvel, wishdir;
@@ -84,8 +90,8 @@ float PM_multijump_checkjump()
                                        curspeed = vlen(vec2(self.velocity));
 #endif
 
-                                       makevectors(PHYS_INPUT_ANGLES(self)_y * '0 1 0');
-                                       wishvel = v_forward * PHYS_INPUT_MOVEVALUES(self)_x + v_right * PHYS_INPUT_MOVEVALUES(self)_y;
+                                       makevectors(self.v_angle_y * '0 1 0');
+                                       wishvel = v_forward * self.movement_x + v_right * self.movement_y;
                                        wishdir = normalize(wishvel);
 
                                        self.velocity_x = wishdir_x * curspeed; // allow "dodging" at a multijump
@@ -95,10 +101,10 @@ float PM_multijump_checkjump()
                                self.multijump_count += 1;
                        }
                }
-               self.multijump_ready = FALSE; // require releasing and pressing the jump button again for the next jump
+               self.multijump_ready = false; // require releasing and pressing the jump button again for the next jump
        }
 
-       return FALSE;
+       return false;
 }
 
 #ifdef SVQC
@@ -107,7 +113,7 @@ MUTATOR_HOOKFUNCTION(multijump_PlayerPhysics)
        multijump_UpdateStats();
        PM_multijump();
 
-       return FALSE;
+       return false;
 }
 
 MUTATOR_HOOKFUNCTION(multijump_PlayerJump)
@@ -118,13 +124,13 @@ MUTATOR_HOOKFUNCTION(multijump_PlayerJump)
 MUTATOR_HOOKFUNCTION(multijump_BuildMutatorsString)
 {
        ret_string = strcat(ret_string, ":multijump");
-       return FALSE;
+       return false;
 }
 
 MUTATOR_HOOKFUNCTION(multijump_BuildMutatorsPrettyString)
 {
        ret_string = strcat(ret_string, ", Multi jump");
-       return FALSE;
+       return false;
 }
 
 MUTATOR_DEFINITION(mutator_multijump)
@@ -139,6 +145,6 @@ MUTATOR_DEFINITION(mutator_multijump)
                multijump_AddStats();
        }
 
-       return FALSE;
+       return false;
 }
 #endif