// ===========
// multijump
// ===========
-seta cl_multijump 1 "allow multijump mutator"
+seta cl_multijump -1 "allow multijump mutator, set to -1 for the server to decide whether it's enabled"
set g_multijump 0 "Number of multiple jumps to allow (jumping again in the air), -1 allows for infinite jumps"
+set g_multijump_client 1 "If the client sets cl_multijump to -1, this setting is used for them as a default"
set g_multijump_add 0 "0 = make the current z velocity equal to jumpvelocity, 1 = add jumpvelocity to the current z velocity"
set g_multijump_speed -999999 "Minimum vertical speed a player must have in order to jump again"
set g_multijump_maxspeed 0
registercvar("cl_shootfromfixedorigin", "");
- registercvar("cl_multijump", "1");
+ registercvar("cl_multijump", "-1");
registercvar("cl_spawn_near_teammate", "1");
#define PHYS_MULTIJUMP_MAXSPEED(s) STAT(MULTIJUMP_MAXSPEED, s)
#define PHYS_MULTIJUMP_DODGING(s) STAT(MULTIJUMP_DODGING, s)
#define PHYS_MULTIJUMP_COUNT(s) STAT(MULTIJUMP_COUNT, s)
+#define PHYS_MULTIJUMP_CLIENTDEFAULT(s) STAT(MULTIJUMP_CLIENT, s)
.bool multijump_ready;
#ifdef CSQC
-bool cvar_cl_multijump;
-bool autocvar_cl_multijump = true;
+int cvar_cl_multijump;
+int autocvar_cl_multijump = -1;
#define PHYS_MULTIJUMP_CLIENT(s) autocvar_cl_multijump
#elif defined(SVQC)
-.bool cvar_cl_multijump;
+.int cvar_cl_multijump;
#define PHYS_MULTIJUMP_CLIENT(s) CS(s).cvar_cl_multijump
#endif
if(!PHYS_MULTIJUMP(player)) { return; }
int client_multijump = PHYS_MULTIJUMP_CLIENT(player);
+ if(client_multijump == -1)
+ client_multijump = PHYS_MULTIJUMP_CLIENTDEFAULT(player);
if(client_multijump > 1)
return; // nope
}
}
-REPLICATE(cvar_cl_multijump, bool, "cl_multijump");
+REPLICATE(cvar_cl_multijump, int, "cl_multijump");
#ifdef SVQC
float autocvar_g_multijump_speed;
float autocvar_g_multijump_maxspeed;
float autocvar_g_multijump_dodging = 1;
+bool autocvar_g_multijump_client = true;
#endif
REGISTER_STAT(MULTIJUMP_DODGING, int, autocvar_g_multijump_dodging)
REGISTER_STAT(MULTIJUMP_MAXSPEED, float, autocvar_g_multijump_maxspeed)
REGISTER_STAT(MULTIJUMP_ADD, int, autocvar_g_multijump_add)
REGISTER_STAT(MULTIJUMP_SPEED, float, autocvar_g_multijump_speed)
+REGISTER_STAT(MULTIJUMP_CLIENT, bool, autocvar_g_multijump_client)
.int multijump_count;
REGISTER_STAT(MULTIJUMP_COUNT, int, this.multijump_count)
REGISTER_STAT(MULTIJUMP, int, autocvar_g_multijump)