Fixed v_cshift issues in malice by simply disabling the v_cshift when the mod specifies the wrong number of arguments (luckily, cshift is cleared between server anyway)

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@825 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2005-01-24 03:05:39 +00:00
parent 28fda441c8
commit a1a71ab87b
1 changed files with 10 additions and 3 deletions

View File

@ -450,6 +450,11 @@ V_cshift_f
*/
void V_cshift_f (void)
{
if (Cmd_Argc() != 5) //this is actually to warn of a malice bug (and prevent a totally black screen) more than it is to help the user. :/
{
Con_Printf("v_cshift: v_cshift <r> <g> <b> <alpha>\n");
return;
}
if (Cmd_FromServer())
{
cl.cshifts[CSHIFT_SERVER].destcolor[0] = atoi(Cmd_Argv(1));
@ -602,10 +607,9 @@ void GLV_CalcBlend (void)
}
else
{
a2 = cl.cshifts[j].percent / 255.0;
a2 = cl.cshifts[j].percent / 255.0; //don't allow modification of this one.
}
// a2 = (cl.cshifts[j].percent/2)/255.0;
if (!a2)
continue;
a = a + a2*(1-a);
@ -748,10 +752,14 @@ void SWV_UpdatePalette (void)
new = false;
force = V_CheckGamma ();
for (i=0 ; i<NUM_CSHIFTS ; i++)
{
if (cl.cshifts[i].percent != cl.prev_cshifts[i].percent)
{
if (i == CSHIFT_SERVER)
force = true; // don't let them cheat.
new = true;
cl.prev_cshifts[i].percent = cl.cshifts[i].percent;
}
@ -773,7 +781,6 @@ void SWV_UpdatePalette (void)
if (cl.cshifts[CSHIFT_BONUS].percent <= 0)
cl.cshifts[CSHIFT_BONUS].percent = 0;
force = V_CheckGamma ();
if (r_pixbytes == 4) //doesn't support palette cycling. It messes up caches.
{