From: Mario Date: Mon, 16 Mar 2015 16:39:06 +0000 (+1100) Subject: Allow true flight with flight buff X-Git-Tag: xonotic-v0.8.1~38^2~16 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8e1c65f7b42e5eb96e2bf245f8b019411d053f14;p=xonotic%2Fxonotic-data.pk3dir.git Allow true flight with flight buff --- diff --git a/qcsrc/common/physics.qc b/qcsrc/common/physics.qc index 01b9755b1..d2287ea18 100644 --- a/qcsrc/common/physics.qc +++ b/qcsrc/common/physics.qc @@ -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) diff --git a/qcsrc/common/physics.qh b/qcsrc/common/physics.qh index d5b8f14ac..01b087455 100644 --- a/qcsrc/common/physics.qh +++ b/qcsrc/common/physics.qh @@ -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