cl.cshifts[CSHIFT_BONUS].percent = 50;
cl.cshifts[CSHIFT_BONUS].alphafade = 100;
}
- else if(Cmd_Argc() == 6)
+ else if(Cmd_Argc() >= 4 && Cmd_Argc() <= 6)
{
cl.cshifts[CSHIFT_BONUS].destcolor[0] = atof(Cmd_Argv(1)) * 255;
cl.cshifts[CSHIFT_BONUS].destcolor[1] = atof(Cmd_Argv(2)) * 255;
cl.cshifts[CSHIFT_BONUS].destcolor[2] = atof(Cmd_Argv(3)) * 255;
- cl.cshifts[CSHIFT_BONUS].percent = atof(Cmd_Argv(4)) * 255; // yes, these are HEXADECIMAL percent ;)
- cl.cshifts[CSHIFT_BONUS].alphafade = atof(Cmd_Argv(5)) * 255;
+ if(Cmd_Argc() >= 5)
+ cl.cshifts[CSHIFT_BONUS].percent = atof(Cmd_Argv(4)) * 255; // yes, these are HEXADECIMAL percent ;)
+ else
+ cl.cshifts[CSHIFT_BONUS].percent = 50;
+ if(Cmd_Argc() >= 6)
+ cl.cshifts[CSHIFT_BONUS].alphafade = atof(Cmd_Argv(5)) * 255;
+ else
+ cl.cshifts[CSHIFT_BONUS].alphafade = 100;
}
else
- Con_Printf("usage:\nbf, or bf R G B A alphafade\n");
+ Con_Printf("usage:\nbf, or bf R G B [A [alphafade]]\n");
}
/*
void V_Init (void)
{
Cmd_AddCommand ("v_cshift", V_cshift_f, "sets tint color of view");
- Cmd_AddCommand ("bf", V_BonusFlash_f, "briefly flashes a bright color tint on view (used when items are picked up); optionally takes R G B A alphafade arguments to specify how the flash looks");
+ Cmd_AddCommand ("bf", V_BonusFlash_f, "briefly flashes a bright color tint on view (used when items are picked up); optionally takes R G B [A [alphafade]] arguments to specify how the flash looks");
Cmd_AddCommand ("centerview", V_StartPitchDrift, "gradually recenter view (stop looking up/down)");
Cvar_RegisterVariable (&v_centermove);