Made sure that deathmatch and coop are not set at the same time

(fix originally from QIP sources of Matthias Buecher, a.k.a. Maddes)

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@536 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
sezero 2011-12-23 12:03:49 +00:00
parent 8dbddbd097
commit fea02186c7
5 changed files with 37 additions and 16 deletions

View file

@ -44,6 +44,7 @@ double host_frametime;
double host_time; double host_time;
double realtime; // without any filtering or bounding double realtime; // without any filtering or bounding
double oldrealtime; // last frame run double oldrealtime; // last frame run
int host_framecount; int host_framecount;
int host_hunklevel; int host_hunklevel;
@ -90,12 +91,11 @@ overflowtimes_t dev_overflows; //this stores the last time overflow messages wer
Max_Edicts_f -- johnfitz Max_Edicts_f -- johnfitz
================ ================
*/ */
void Max_Edicts_f (void) static void Max_Edicts_f (void)
{ {
static float oldval = DEF_EDICTS; //must match the default value for max_edicts static float oldval = DEF_EDICTS; //must match the default value for max_edicts
//TODO: clamp it here? //TODO: clamp it here?
if (max_edicts.value == oldval) if (max_edicts.value == oldval)
return; return;
@ -105,6 +105,19 @@ void Max_Edicts_f (void)
oldval = max_edicts.value; oldval = max_edicts.value;
} }
// 1999-09-06 deathmatch/coop not at the same time fix by Maddes
static void Callback_Deathmatch (void)
{
if (deathmatch.value)
Cvar_Set ("coop", "0");
}
static void Callback_Coop (void)
{
if (coop.value)
Cvar_Set ("deathmatch", "0");
}
/* /*
================ ================
Host_EndGame Host_EndGame
@ -261,8 +274,8 @@ void Host_InitLocal (void)
Cvar_RegisterVariable (&noexit, NULL); Cvar_RegisterVariable (&noexit, NULL);
Cvar_RegisterVariable (&skill, NULL); Cvar_RegisterVariable (&skill, NULL);
Cvar_RegisterVariable (&developer, NULL); Cvar_RegisterVariable (&developer, NULL);
Cvar_RegisterVariable (&deathmatch, NULL); Cvar_RegisterVariable (&coop, Callback_Coop);
Cvar_RegisterVariable (&coop, NULL); Cvar_RegisterVariable (&deathmatch, Callback_Deathmatch);
Cvar_RegisterVariable (&pausable, NULL); Cvar_RegisterVariable (&pausable, NULL);

View file

@ -210,9 +210,13 @@ static void MaxPlayers_f (void)
if (n == 1) if (n == 1)
{ {
Cvar_Set ("deathmatch", "0"); Cvar_Set ("deathmatch", "0");
Cvar_Set ("coop", "0");
} }
else else
{ {
if (coop.value)
Cvar_Set ("deathmatch", "0");
else
Cvar_Set ("deathmatch", "1"); Cvar_Set ("deathmatch", "1");
} }
} }

View file

@ -11,7 +11,7 @@
<PRE> <PRE>
</PRE> </PRE>
</P> </P>
<P>QuakeSpasm 0.85.5 (20 December 2011)</P> <P>QuakeSpasm 0.85.5 (25 December 2011)</P>
<P> <P>
<H2><A NAME="toc1">1.</A> <A HREF="README.html#s1">About </A></H2> <H2><A NAME="toc1">1.</A> <A HREF="README.html#s1">About </A></H2>
@ -160,7 +160,7 @@ Compile time options include
<UL> <UL>
<LI> SDL input driver updated adding native keymap and dead key support to the console</LI> <LI> SDL input driver updated adding native keymap and dead key support to the console</LI>
<LI> Fixed a crash in net play in maps with extended limits</LI> <LI> Fixed a crash in net play in maps with extended limits</LI>
<LI> Verified successful compilation using gcc-4.6</LI> <LI> Verified successful compilation using gcc-4.6.x</LI>
<LI> Added a cvar gl_zfix to stop GL texture flicker (z fighting)</LI> <LI> Added a cvar gl_zfix to stop GL texture flicker (z fighting)</LI>
<LI> Read video variables early so that a vid_restart isn't necessary after init</LI> <LI> Read video variables early so that a vid_restart isn't necessary after init</LI>
<LI> mlook and lookspring fixes</LI> <LI> mlook and lookspring fixes</LI>
@ -168,6 +168,7 @@ Compile time options include
<LI> Made mp3 playback to allocate system memory instead of zone</LI> <LI> Made mp3 playback to allocate system memory instead of zone</LI>
<LI> Some updates to the progs interpreter code</LI> <LI> Some updates to the progs interpreter code</LI>
<LI> Fixed r_nolerp_list parsing code from fitzquake</LI> <LI> Fixed r_nolerp_list parsing code from fitzquake</LI>
<LI> Made sure that deathmatch and coop are not set at the same time</LI>
<LI> Several code updates from uHexen2, several code cleanups.</LI> <LI> Several code updates from uHexen2, several code cleanups.</LI>
</UL> </UL>
</P> </P>

View file

@ -4,7 +4,7 @@
<toc> <toc>
<verb></verb> <verb></verb>
QuakeSpasm 0.85.5 (20 December 2011) QuakeSpasm 0.85.5 (25 December 2011)
<sect> About <p> <sect> About <p>
@ -94,7 +94,7 @@ Alternatively, have a look at <bf>Makefile.darwin</bf> for more instructions on
<itemize> <itemize>
<item> SDL input driver updated adding native keymap and dead key support to the console <item> SDL input driver updated adding native keymap and dead key support to the console
<item> Fixed a crash in net play in maps with extended limits <item> Fixed a crash in net play in maps with extended limits
<item> Verified successful compilation using gcc-4.6 <item> Verified successful compilation using gcc-4.6.x
<item> Added a cvar gl_zfix to stop GL texture flicker (z fighting) <item> Added a cvar gl_zfix to stop GL texture flicker (z fighting)
<item> Read video variables early so that a vid_restart isn't necessary after init <item> Read video variables early so that a vid_restart isn't necessary after init
<item> mlook and lookspring fixes <item> mlook and lookspring fixes
@ -102,6 +102,7 @@ Alternatively, have a look at <bf>Makefile.darwin</bf> for more instructions on
<item> Made mp3 playback to allocate system memory instead of zone <item> Made mp3 playback to allocate system memory instead of zone
<item> Some updates to the progs interpreter code <item> Some updates to the progs interpreter code
<item> Fixed r_nolerp_list parsing code from fitzquake <item> Fixed r_nolerp_list parsing code from fitzquake
<item> Made sure that deathmatch and coop are not set at the same time
<item> Several code updates from uHexen2, several code cleanups. <item> Several code updates from uHexen2, several code cleanups.
</itemize> </itemize>
</p> </p>

View file

@ -29,7 +29,7 @@
______________________________________________________________________ ______________________________________________________________________
QuakeSpasm 0.85.5 (20 December 2011) QuakeSpasm 0.85.5 (25 December 2011)
1. About 1. About
@ -161,7 +161,7 @@
o Fixed a crash in net play in maps with extended limits o Fixed a crash in net play in maps with extended limits
o Verified successful compilation using gcc-4.6 o Verified successful compilation using gcc-4.6.x
o Added a cvar gl_zfix to stop GL texture flicker (z fighting) o Added a cvar gl_zfix to stop GL texture flicker (z fighting)
@ -179,6 +179,8 @@
o Fixed r_nolerp_list parsing code from fitzquake o Fixed r_nolerp_list parsing code from fitzquake
o Made sure that deathmatch and coop are not set at the same time
o Several code updates from uHexen2, several code cleanups. o Several code updates from uHexen2, several code cleanups.
5.2. Changes in 0.85.4 5.2. Changes in 0.85.4