dot = DotProduct(s->velocity, wishdir);
if(dot > 0) { // we can't change direction while slowing down
- k *= cl.movevars_aircontrol*pow(dot, cl.movevars_aircontrol_power)*s->cmd.frametime;
+ k *= pow(dot, cl.movevars_aircontrol_power)*s->cmd.frametime;
+ speed = max(0, speed - cl.movevars_aircontrol_penalty * sqrt(max(0, 1 - dot*dot)) * k/32);
+ k *= cl.movevars_aircontrol;
VectorMAM(speed, s->velocity, k, wishdir, s->velocity);
VectorNormalize(s->velocity);
}
cl.movevars_airstrafeaccel_qw = cl.statsf[STAT_MOVEVARS_AIRSTRAFEACCEL_QW];
cl.movevars_aircontrol = cl.statsf[STAT_MOVEVARS_AIRCONTROL];
cl.movevars_aircontrol_power = cl.statsf[STAT_MOVEVARS_AIRCONTROL_POWER];
+ cl.movevars_aircontrol_penalty = cl.statsf[STAT_MOVEVARS_AIRCONTROL_PENALTY];
cl.movevars_warsowbunny_airforwardaccel = cl.statsf[STAT_MOVEVARS_WARSOWBUNNY_AIRFORWARDACCEL];
cl.movevars_warsowbunny_accel = cl.statsf[STAT_MOVEVARS_WARSOWBUNNY_ACCEL];
cl.movevars_warsowbunny_topspeed = cl.statsf[STAT_MOVEVARS_WARSOWBUNNY_TOPSPEED];
cl.movevars_airstrafeaccel_qw = 0;
cl.movevars_aircontrol = 0;
cl.movevars_aircontrol_power = 2;
+ cl.movevars_aircontrol_penalty = 0;
cl.movevars_warsowbunny_airforwardaccel = 0;
cl.movevars_warsowbunny_accel = 0;
cl.movevars_warsowbunny_topspeed = 0;
float movevars_airstrafeaccel_qw;
float movevars_aircontrol;
float movevars_aircontrol_power;
+ float movevars_aircontrol_penalty;
float movevars_warsowbunny_airforwardaccel;
float movevars_warsowbunny_accel;
float movevars_warsowbunny_topspeed;
//#define STAT_TIME 17 ///< FTE
//#define STAT_VIEW2 20 ///< FTE
#define STAT_VIEWZOOM 21 ///< DP
+#define STAT_MOVEVARS_AIRCONTROL_PENALTY 221 ///< DP
#define STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW 222 ///< DP
#define STAT_MOVEVARS_AIRSTRAFEACCEL_QW 223 ///< DP
#define STAT_MOVEVARS_AIRCONTROL_POWER 224 ///< DP
extern cvar_t sv_airstrafeaccel_qw;
extern cvar_t sv_aircontrol;
extern cvar_t sv_aircontrol_power;
+extern cvar_t sv_aircontrol_penalty;
extern cvar_t sv_airspeedlimit_nonqw;
extern cvar_t sv_allowdownloads;
extern cvar_t sv_allowdownloads_archive;
cvar_t sv_airstrafeaccel_qw = {0, "sv_airstrafeaccel_qw", "0", "when set, replacement for sv_airaccel_qw when just strafing"};
cvar_t sv_aircontrol = {0, "sv_aircontrol", "0", "CPMA-style air control"};
cvar_t sv_aircontrol_power = {0, "sv_aircontrol_power", "2", "CPMA-style air control exponent"};
+cvar_t sv_aircontrol_penalty = {0, "sv_aircontrol_penalty", "0", "deceleration while using CPMA-style air control"};
cvar_t sv_allowdownloads = {0, "sv_allowdownloads", "1", "whether to allow clients to download files from the server (does not affect http downloads)"};
cvar_t sv_allowdownloads_archive = {0, "sv_allowdownloads_archive", "0", "whether to allow downloads of archives (pak/pk3)"};
cvar_t sv_allowdownloads_config = {0, "sv_allowdownloads_config", "0", "whether to allow downloads of config files (cfg)"};
Cvar_RegisterVariable (&sv_airspeedlimit_nonqw);
Cvar_RegisterVariable (&sv_aircontrol);
Cvar_RegisterVariable (&sv_aircontrol_power);
+ Cvar_RegisterVariable (&sv_aircontrol_penalty);
Cvar_RegisterVariable (&sv_allowdownloads);
Cvar_RegisterVariable (&sv_allowdownloads_archive);
Cvar_RegisterVariable (&sv_allowdownloads_config);
statsf[STAT_MOVEVARS_AIRSTRAFEACCEL_QW] = sv_airstrafeaccel_qw.value;
statsf[STAT_MOVEVARS_AIRCONTROL] = sv_aircontrol.value;
statsf[STAT_MOVEVARS_AIRCONTROL_POWER] = sv_aircontrol_power.value;
+ statsf[STAT_MOVEVARS_AIRCONTROL_PENALTY] = sv_aircontrol_penalty.value;
statsf[STAT_MOVEVARS_WARSOWBUNNY_AIRFORWARDACCEL] = sv_warsowbunny_airforwardaccel.value;
statsf[STAT_MOVEVARS_WARSOWBUNNY_ACCEL] = sv_warsowbunny_accel.value;
statsf[STAT_MOVEVARS_WARSOWBUNNY_TOPSPEED] = sv_warsowbunny_topspeed.value;