]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Allow true flight with flight buff
authorMario <zacjardine@y7mail.com>
Mon, 16 Mar 2015 16:39:06 +0000 (03:39 +1100)
committerMario <zacjardine@y7mail.com>
Mon, 16 Mar 2015 16:39:06 +0000 (03:39 +1100)
qcsrc/common/physics.qc
qcsrc/common/physics.qh

index 01b9755b1b237608cbd76cf192533920fa9fa391..d2287ea18a8fee0db3666acb2b071ad7e70c91e4 100644 (file)
@@ -1084,8 +1084,11 @@ void PM_fly(float maxspd_mod)
        // acceleration
        vector wishdir = normalize(wishvel);
        float wishspeed = min(vlen(wishvel), PHYS_MAXSPEED(self) * maxspd_mod);
+#ifdef SVQC
        if (time >= self.teleport_time)
+#endif
                PM_Accelerate(wishdir, wishspeed, wishspeed, PHYS_ACCELERATE * maxspd_mod, 1, 0, 0, 0);
+       PM_ClientMovement_Move();
 }
 
 void PM_swim(float maxspd_mod)
@@ -1166,9 +1169,9 @@ void PM_swim(float maxspd_mod)
 #endif
                }
        }
-       PM_ClientMovement_Move();
        // water acceleration
        PM_Accelerate(wishdir, wishspeed, wishspeed, PHYS_ACCELERATE * maxspd_mod, 1, 0, 0, 0);
+       PM_ClientMovement_Move();
 }
 
 void PM_ladder(float maxspd_mod)
@@ -1216,12 +1219,12 @@ void PM_ladder(float maxspd_mod)
        // acceleration
        vector wishdir = normalize(wishvel);
        float wishspeed = min(vlen(wishvel), PHYS_MAXSPEED(self) * maxspd_mod);
-       PM_ClientMovement_Move();
 #ifdef SVQC
        if (time >= self.teleport_time)
 #endif
                // water acceleration
                PM_Accelerate(wishdir, wishspeed, wishspeed, PHYS_ACCELERATE*maxspd_mod, 1, 0, 0, 0);
+       PM_ClientMovement_Move();
 }
 
 void PM_jetpack(float maxspd_mod)
@@ -1705,7 +1708,7 @@ void PM_Main()
                RaceCarPhysics();
 #endif
 
-       else if (self.movetype == MOVETYPE_NOCLIP || self.movetype == MOVETYPE_FLY || self.movetype == MOVETYPE_FLY_WORLDONLY)
+       else if (self.movetype == MOVETYPE_NOCLIP || self.movetype == MOVETYPE_FLY || self.movetype == MOVETYPE_FLY_WORLDONLY || (BUFFS(self) & BUFF_FLIGHT))
                PM_fly(maxspeed_mod);
 
        else if (self.waterlevel >= WATERLEVEL_SWIMMING)
index d5b8f14acc66c8e0332118c03ac8f39800da52b7..01b08745597852768ed3158ae58e86a8b24ea2d0 100644 (file)
@@ -92,6 +92,7 @@ bool IsFlying(entity a);
        #define WAS_ONGROUND(s)                                         !!(s.lastflags & FL_ONGROUND)
 
        #define ITEMS(s)                                                        (s).items
+       #define BUFFS(s)                                                        getstati(STAT_BUFFS)
 
        #define PHYS_AMMO_FUEL(s)                                       getstati(STAT_FUEL)
 
@@ -260,6 +261,7 @@ bool IsFlying(entity a);
        #define WAS_ONGROUND(s)                                         !!((s).lastflags & FL_ONGROUND)
 
        #define ITEMS(s)                                                        s.items
+       #define BUFFS(s)                                                        (s).buffs
 
        #define PHYS_AMMO_FUEL(s)                                       s.ammo_fuel