localcmd("sv_cmd debug_shotorg\n");
}
else if(cmd == "sendcvar") {
- s = cvar_string(argv(1));
- if(argv(1) == "cl_weaponpriority")
+ // W_FixWeaponOrder will trash argv, so save what we need.
+ string cvar;
+ cvar = strzone(argv(1));
+ s = cvar_string(cvar);
+ if(cvar == "cl_weaponpriority")
s = W_FixWeaponOrder(W_NumberWeaponOrder(s), 1);
- else if(substring(argv(1), 0, 17) == "cl_weaponpriority" && strlen(argv(1)) == 18)
+ else if(substring(cvar, 0, 17) == "cl_weaponpriority" && strlen(cvar) == 18)
s = W_FixWeaponOrder(W_NumberWeaponOrder(s), 0);
- localcmd("cmd sentcvar ", argv(1), " \"", s, "\"\n");
+ localcmd("cmd sentcvar ", cvar, " \"", s, "\"\n");
+ strunzone(cvar);
}
else if(cmd == "spawn") {
s = argv(1);
}
}
else
- stuffcmd(self, strcat("sendcvar ", name, "\n"));
+ stuffcmd(self, strcat("cl_cmd sendcvar ", name, "\n"));
}
void GetCvars_handleString_Fixup(string thisname, float f, .string field, string name, string(string) func)
{
self.field = stof(argv(f + 1));
}
else
- stuffcmd(self, strcat("sendcvar ", name, "\n"));
+ stuffcmd(self, strcat("cl_cmd sendcvar ", name, "\n"));
}
void GetCvars_handleFloatOnce(string thisname, float f, .float field, string name)
{
else
{
if(!self.field)
- stuffcmd(self, strcat("sendcvar ", name, "\n"));
+ stuffcmd(self, strcat("cl_cmd sendcvar ", name, "\n"));
}
}
string W_FixWeaponOrder_ForceComplete(string s);