Esempio n. 1
0
/*
================
G_RunFrame

Advances the world by 0.1 seconds
================
*/
void G_RunFrame (void)
{
	int		i;
	edict_t	*ent;

	level.framenum++;
	level.time = level.framenum*FRAMETIME;

	// choose a client for monsters to target this frame
	AI_SetSightClient ();

	// exit intermissions

	if (level.exitintermission)
	{
		ExitLevel ();
		return;
	}

	//
	// treat each object in turn
	// even the world gets a chance to think
	//
	ent = &g_edicts[0];
	for (i=0 ; i<globals.num_edicts ; i++, ent++)
	{
		if (!ent->inuse)
			continue;

		level.current_entity = ent;

		VectorCopy (ent->s.origin, ent->s.old_origin);

		// if the ground entity moved, make sure we are still on it
		if ((ent->groundentity) && (ent->groundentity->linkcount != ent->groundentity_linkcount))
		{
			ent->groundentity = NULL;
			if ( !(ent->flags & (FL_SWIM|FL_FLY)) && (ent->svflags & SVF_MONSTER) )
			{
				M_CheckGround (ent);
			}
		}

		if (i > 0 && i <= maxclients->value)
		{
			ClientBeginServerFrame (ent);
			continue;
		}

		G_RunEntity (ent);
	}

	// see if it is time to end a deathmatch
	CheckDMRules ();

	// build the playerstate_t structures for all players
	ClientEndServerFrames ();
}
Esempio n. 2
0
void G_RunFrame(void)
{
	// Knightmare- dm pause
	if (paused && deathmatch->value)
		return;

	if (level.freeze)
	{
		level.freezeframes++;
		if (level.freezeframes >= sk_stasis_time->value * 10)
			level.freeze = false;
	}
	else
	{
		level.framenum++;
	}

	level.time = level.framenum*FRAMETIME;

	// choose a client for monsters to target this frame
	AI_SetSightClient();

	// exit intermissions
	if (level.exitintermission)
	{
		ExitLevel();
		return;
	}

	if (use_techs->value || (ctf->value && !((int)dmflags->value & DF_CTF_NO_TECH)) )
		CheckNumTechs();

	//
	// treat each object in turn
	// even the world gets a chance to think
	//
	edict_t *ent = &g_edicts[0];
	for (int i = 0; i < globals.num_edicts; i++, ent++)
	{
		if (!ent->inuse)
			continue;

		level.current_entity = ent;

		VectorCopy(ent->s.origin, ent->s.old_origin);

		// if the ground entity moved, make sure we are still on it
		if (ent->groundentity && ent->groundentity->linkcount != ent->groundentity_linkcount)
		{
			ent->groundentity = NULL;
			if (!(ent->flags & (FL_SWIM | FL_FLY)) && (ent->svflags & SVF_MONSTER))
				M_CheckGround(ent);
		}

		if (i > 0 && i <= maxclients->value)
		{
			ClientBeginServerFrame(ent);
// ACEBOT_ADD
			if (!ent->is_bot) // Bots need G_RunEntity called
				continue;
// ACEBOT_END
		}

		G_RunEntity(ent);
	}

	// see if it is time to end a deathmatch
	CheckDMRules();

	// see if needpass needs updated
	CheckNeedPass();

	// build the playerstate_t structures for all players
	ClientEndServerFrames();
}
Esempio n. 3
0
File: g_main.c Progetto: ZwS/qudos
/*
 * ================ G_RunFrame
 *
 * Advances the world by 0.1 seconds ================
 */
void
G_RunFrame(void)
{
	int		i;
	edict_t        *ent;

#ifdef GAME_MOD
	Blinky_BeginRunFrame();
#endif

	level.framenum++;
	level.time = level.framenum * FRAMETIME;

	/* choose a client for monsters to target this frame */
	AI_SetSightClient();

	/* exit intermissions */

	if (level.exitintermission) {
		ExitLevel();
		return;
	}
	//
	/* treat each object in turn */
	/* even the world gets a chance to think */
	    //
	    ent = &g_edicts[0];
	for (i = 0; i < globals.num_edicts; i++, ent++) {
		if (!ent->inuse)
			continue;

		level.current_entity = ent;

		VectorCopy(ent->s.origin, ent->s.old_origin);

		/* if the ground entity moved, make sure we are still on it */
		if ((ent->groundentity) && (ent->groundentity->linkcount != ent->groundentity_linkcount)) {
			ent->groundentity = NULL;
			if (!(ent->flags & (FL_SWIM | FL_FLY)) && (ent->svflags & SVF_MONSTER)) {
				M_CheckGround(ent);
			}
		}
		if (i > 0 && i <= maxclients->value) {
			ClientBeginServerFrame(ent);
#ifdef WITH_ACEBOT
			/* continue; */
#else
			continue;
#endif
		}
		G_RunEntity(ent);
	}

	/* see if it is time to end a deathmatch */
	CheckDMRules();

	/* see if needpass needs updated */
	CheckNeedPass();

	/* build the playerstate_t structures for all players */
	ClientEndServerFrames();
}