This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
// host.c -- coordinates spawning and killing of local servers
#include "quakedef.h"
+#include <time.h>
/*
else
svs.maxclients = 8;
}
+
+ // BloodBath doesn't support single player games
+ if (gamemode == GAME_BLOODBATH && svs.maxclients < 4)
+ svs.maxclients = 4;
+
if (svs.maxclients < 1)
svs.maxclients = 8;
else if (svs.maxclients > MAX_SCOREBOARD)
=================
SV_ClientPrintf
-Sends text across to be displayed
+Sends text across to be displayed
FIXME: make this just a stuffed echo?
=================
*/
Returns false if the time is too short to run a frame
===================
*/
+extern cvar_t cl_avidemo;
qboolean Host_FilterTime (double time)
{
double timecap;
Cvar_SetValue("host_minfps", 10.0f);
if (host_maxfps.value < host_minfps.value)
Cvar_SetValue("host_maxfps", host_minfps.value);
+ if (cl_avidemo.value < 0.1f)
+ Cvar_SetValue("cl_avidemo", 0.0f);
- // check if framerate is too high
- if (!cls.timedemo)
+ // check if framerate is too high
+ if (cl_avidemo.value >= 0.1f)
+ {
+ timecap = 1.0 / (double)cl_avidemo.value;
+ if ((realtime - oldrealtime) < timecap)
+ return false;
+ }
+ else if (!cls.timedemo)
{
timecap = sys_ticrate.value;
if (cls.state == ca_connected)
if (host_framerate.value > 0)
host_frametime = host_framerate.value;
+ else if (cl_avidemo.value >= 0.1f)
+ {
+ // don't allow really short frames
+ //if (host_frametime > (1.0 / cl_avidemo.value))
+ host_frametime = (1.0 / cl_avidemo.value);
+ }
else
{
// don't allow really short frames
}
cl.frametime = host_frametime = bound(0, host_frametime * slowmo.value, 0.1f); // LordHavoc: the QC code relies on no less than 10fps
-
+
return true;
}
*/
void Host_Init (void)
{
+ // LordHavoc: quake never seeded the random number generator before... heh
+ srand(time(NULL));
+
com_argc = host_parms.argc;
com_argv = host_parms.argv;
// FIXME: this is evil, but possibly temporary