Example #1
0
        public static void G_RunFrame()
        {
            int     i;
            edict_t ent;

            level.framenum++;
            level.time = level.framenum * Defines.FRAMETIME;
            GameAI.AI_SetSightClient();
            if (level.exitintermission)
            {
                ExitLevel();
                return;
            }

            for (i = 0; i < num_edicts; i++)
            {
                ent = g_edicts[i];
                if (!ent.inuse)
                {
                    continue;
                }
                level.current_entity = ent;
                Math3D.VectorCopy(ent.s.origin, ent.s.old_origin);
                if ((ent.groundentity != null) && (ent.groundentity.linkcount != ent.groundentity_linkcount))
                {
                    ent.groundentity = null;
                    if (0 == (ent.flags & (Defines.FL_SWIM | Defines.FL_FLY)) && (ent.svflags & Defines.SVF_MONSTER) != 0)
                    {
                        M.M_CheckGround(ent);
                    }
                }

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

                G_RunEntity(ent);
            }

            CheckDMRules();
            CheckNeedPass();
            ClientEndServerFrames();
        }