addstat(STAT_DOUBLEJUMP, AS_INT, stat_doublejump);
// jump speed caps
- addstat(STAT_MOVEVARS_JUMPSPEEDCAP_MIN, AS_FLOAT, stat_jumpspeedcap_min);
- addstat(STAT_MOVEVARS_JUMPSPEEDCAP_MIN, AS_FLOAT, stat_jumpspeedcap_min);
addstat(STAT_MOVEVARS_JUMPSPEEDCAP_DISABLE_ONRAMPS, AS_INT, stat_jumpspeedcap_disable_onramps);
// hacks
self.stat_jetpack_maxspeed_up = PHYS_JETPACK_MAXSPEED_UP;
self.stat_jetpack_fuel = PHYS_JETPACK_FUEL;
- self.stat_jumpspeedcap_min = PHYS_JUMPSPEEDCAP_MIN;
- self.stat_jumpspeedcap_max = PHYS_JUMPSPEEDCAP_MAX;
self.stat_jumpspeedcap_disable_onramps = PHYS_JUMPSPEEDCAP_DISABLE_ONRAMPS;
self.stat_sv_friction_on_land = PHYS_FRICTION_ONLAND;
// velocity bounds. Final velocity is bound between (jumpheight *
// min + jumpheight) and (jumpheight * max + jumpheight);
- if(PHYS_JUMPSPEEDCAP_MIN)
+ if(PHYS_JUMPSPEEDCAP_MIN != "")
{
- float minjumpspeed = mjumpheight * PHYS_JUMPSPEEDCAP_MIN;
+ float minjumpspeed = mjumpheight * stof(PHYS_JUMPSPEEDCAP_MIN);
if (self.velocity_z < minjumpspeed)
mjumpheight += minjumpspeed - self.velocity_z;
}
- if(PHYS_JUMPSPEEDCAP_MAX)
+ if(PHYS_JUMPSPEEDCAP_MAX != "")
{
// don't do jump speedcaps on ramps to preserve old xonotic ramjump style
tracebox(self.origin + '0 0 0.01', self.mins, self.maxs, self.origin - '0 0 0.01', MOVE_NORMAL, self);
if (!(trace_fraction < 1 && trace_plane_normal_z < 0.98 && PHYS_JUMPSPEEDCAP_DISABLE_ONRAMPS))
{
- float maxjumpspeed = mjumpheight * PHYS_JUMPSPEEDCAP_MAX;
+ float maxjumpspeed = mjumpheight * stof(PHYS_JUMPSPEEDCAP_MAX);
if (self.velocity_z > maxjumpspeed)
mjumpheight -= self.velocity_z - maxjumpspeed;
stuffcmd(self, strcat("cl_sidespeed ", temps, "\n"));
stuffcmd(self, strcat("cl_upspeed ", temps, "\n"));
}
+
+ if(self.stat_jumpspeedcap_min != PHYS_JUMPSPEEDCAP_MIN)
+ {
+ self.stat_jumpspeedcap_min = PHYS_JUMPSPEEDCAP_MIN;
+ stuffcmd(self, strcat("cl_jumpspeedcap_min ", PHYS_JUMPSPEEDCAP_MIN, "\n"));
+ }
+ if(self.stat_jumpspeedcap_max != PHYS_JUMPSPEEDCAP_MAX)
+ {
+ self.stat_jumpspeedcap_min = PHYS_JUMPSPEEDCAP_MAX;
+ stuffcmd(self, strcat("cl_jumpspeedcap_max ", PHYS_JUMPSPEEDCAP_MAX, "\n"));
+ }
#endif
if(PHYS_DEAD(self))
#define PHYS_BUGRIGS_REVERSE_SPINNING getstatf(STAT_BUGRIGS_REVERSE_SPINNING)
#define PHYS_BUGRIGS_REVERSE_STOPPING getstatf(STAT_BUGRIGS_REVERSE_STOPPING)
- #define PHYS_JUMPSPEEDCAP_MIN getstatf(STAT_MOVEVARS_JUMPSPEEDCAP_MIN)
- #define PHYS_JUMPSPEEDCAP_MAX getstatf(STAT_MOVEVARS_JUMPSPEEDCAP_MAX)
+ #define PHYS_JUMPSPEEDCAP_MIN cvar_string("cl_jumpspeedcap_min")
+ #define PHYS_JUMPSPEEDCAP_MAX cvar_string("cl_jumpspeedcap_max")
#define PHYS_JUMPSPEEDCAP_DISABLE_ONRAMPS getstati(STAT_MOVEVARS_JUMPSPEEDCAP_DISABLE_ONRAMPS)
#define PHYS_TRACK_CANJUMP(s) getstati(STAT_MOVEVARS_TRACK_CANJUMP)
.float stat_doublejump;
- .float stat_jumpspeedcap_min;
- .float stat_jumpspeedcap_max;
+ .string stat_jumpspeedcap_min;
+ .string stat_jumpspeedcap_max;
.float stat_jumpspeedcap_disable_onramps;
.float stat_jetpack_accel_side;
int autocvar_sv_gentle;
#define autocvar_sv_gravity cvar("sv_gravity")
string autocvar_sv_intermission_cdtrack;
-float autocvar_sv_jumpspeedcap_max;
+string autocvar_sv_jumpspeedcap_max;
float autocvar_sv_jumpspeedcap_max_disable_on_ramps;
-float autocvar_sv_jumpspeedcap_min;
+string autocvar_sv_jumpspeedcap_min;
float autocvar_sv_jumpvelocity;
bool autocvar_sv_logscores_bots;
bool autocvar_sv_logscores_console;