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: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@536 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Ozkan Sezer 2011-12-23 12:03:49 +00:00
parent 0953ac6751
commit ec9b77878b
5 changed files with 37 additions and 16 deletions

View file

@ -44,11 +44,12 @@ double host_frametime;
double host_time;
double realtime; // without any filtering or bounding
double oldrealtime; // last frame run
int host_framecount;
int host_hunklevel;
int host_framecount;
int minimum_memory;
int host_hunklevel;
int minimum_memory;
client_t *host_client; // current client
@ -70,8 +71,8 @@ cvar_t timelimit = {"timelimit","0",false,true};
cvar_t teamplay = {"teamplay","0",false,true};
cvar_t samelevel = {"samelevel","0"};
cvar_t noexit = {"noexit","0",false,true};
cvar_t skill = {"skill","1"}; // 0 - 3
cvar_t deathmatch = {"deathmatch","0"}; // 0, 1, or 2
cvar_t skill = {"skill","1"}; // 0 - 3
cvar_t deathmatch = {"deathmatch","0"}; // 0, 1, or 2
cvar_t coop = {"coop","0"}; // 0 or 1
cvar_t pausable = {"pausable","1"};
@ -90,12 +91,11 @@ overflowtimes_t dev_overflows; //this stores the last time overflow messages wer
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
//TODO: clamp it here?
if (max_edicts.value == oldval)
return;
@ -105,6 +105,19 @@ void Max_Edicts_f (void)
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
@ -261,8 +274,8 @@ void Host_InitLocal (void)
Cvar_RegisterVariable (&noexit, NULL);
Cvar_RegisterVariable (&skill, NULL);
Cvar_RegisterVariable (&developer, NULL);
Cvar_RegisterVariable (&deathmatch, NULL);
Cvar_RegisterVariable (&coop, NULL);
Cvar_RegisterVariable (&coop, Callback_Coop);
Cvar_RegisterVariable (&deathmatch, Callback_Deathmatch);
Cvar_RegisterVariable (&pausable, NULL);

View file

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

View file

@ -11,7 +11,7 @@
<PRE>
</PRE>
</P>
<P>QuakeSpasm 0.85.5 (20 December 2011)</P>
<P>QuakeSpasm 0.85.5 (25 December 2011)</P>
<P>
<H2><A NAME="toc1">1.</A> <A HREF="README.html#s1">About </A></H2>
@ -160,7 +160,7 @@ Compile time options include
<UL>
<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> 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> Read video variables early so that a vid_restart isn't necessary after init</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> Some updates to the progs interpreter code</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>
</UL>
</P>

View file

@ -4,7 +4,7 @@
<toc>
<verb></verb>
QuakeSpasm 0.85.5 (20 December 2011)
QuakeSpasm 0.85.5 (25 December 2011)
<sect> About <p>
@ -94,7 +94,7 @@ Alternatively, have a look at <bf>Makefile.darwin</bf> for more instructions on
<itemize>
<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> 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> Read video variables early so that a vid_restart isn't necessary after init
<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> Some updates to the progs interpreter code
<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.
</itemize>
</p>

View file

@ -29,7 +29,7 @@
______________________________________________________________________
QuakeSpasm 0.85.5 (20 December 2011)
QuakeSpasm 0.85.5 (25 December 2011)
1. About
@ -161,7 +161,7 @@
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)
@ -179,6 +179,8 @@
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.
5.2. Changes in 0.85.4