Clear() public method

public Clear ( ) : void
return void
Esempio n. 1
0
        /// <summary>
        /// CL_BaseMove
        /// Send the intended movement message to the server
        /// </summary>
        private void BaseMove(ref usercmd_t cmd)
        {
            if (cls.signon != ClientDef.SIGNONS)
            {
                return;
            }

            AdjustAngles( );

            cmd.Clear( );

            if (client_input.StrafeBtn.IsDown)
            {
                cmd.sidemove += Host.Cvars.SideSpeed.Get <Single>( ) * KeyState(ref client_input.RightBtn);
                cmd.sidemove -= Host.Cvars.SideSpeed.Get <Single>( ) * KeyState(ref client_input.LeftBtn);
            }

            cmd.sidemove += Host.Cvars.SideSpeed.Get <Single>( ) * KeyState(ref client_input.MoveRightBtn);
            cmd.sidemove -= Host.Cvars.SideSpeed.Get <Single>( ) * KeyState(ref client_input.MoveLeftBtn);

            var upBtn = KeyState(ref client_input.UpBtn);

            if (upBtn > 0)
            {
                Console.WriteLine("asd");
            }
            cmd.upmove += Host.Cvars.UpSpeed.Get <Single>( ) * KeyState(ref client_input.UpBtn);
            cmd.upmove -= Host.Cvars.UpSpeed.Get <Single>( ) * KeyState(ref client_input.DownBtn);

            if (!client_input.KLookBtn.IsDown)
            {
                cmd.forwardmove += Host.Cvars.ForwardSpeed.Get <Single>( ) * KeyState(ref client_input.ForwardBtn);
                cmd.forwardmove -= Host.Cvars.BackSpeed.Get <Single>( ) * KeyState(ref client_input.BackBtn);
            }

            //
            // adjust for speed key
            //
            if (client_input.SpeedBtn.IsDown)
            {
                cmd.forwardmove *= Host.Cvars.MoveSpeedKey.Get <Single>( );
                cmd.sidemove    *= Host.Cvars.MoveSpeedKey.Get <Single>( );
                cmd.upmove      *= Host.Cvars.MoveSpeedKey.Get <Single>( );
            }
        }
Esempio n. 2
0
        /// <summary>
        /// CL_BaseMove
        /// Send the intended movement message to the server
        /// </summary>
        private static void BaseMove(ref usercmd_t cmd)
        {
            if (cls.signon != SIGNONS)
            {
                return;
            }

            AdjustAngles();

            cmd.Clear();

            if (client_input.StrafeBtn.IsDown)
            {
                cmd.sidemove += _SideSpeed.Value * KeyState(ref client_input.RightBtn);
                cmd.sidemove -= _SideSpeed.Value * KeyState(ref client_input.LeftBtn);
            }

            cmd.sidemove += _SideSpeed.Value * KeyState(ref client_input.MoveRightBtn);
            cmd.sidemove -= _SideSpeed.Value * KeyState(ref client_input.MoveLeftBtn);

            cmd.upmove += _UpSpeed.Value * KeyState(ref client_input.UpBtn);
            cmd.upmove -= _UpSpeed.Value * KeyState(ref client_input.DownBtn);

            if (!client_input.KLookBtn.IsDown)
            {
                cmd.forwardmove += _ForwardSpeed.Value * KeyState(ref client_input.ForwardBtn);
                cmd.forwardmove -= _BackSpeed.Value * KeyState(ref client_input.BackBtn);
            }

            //
            // adjust for speed key
            //
            if (client_input.SpeedBtn.IsDown)
            {
                cmd.forwardmove *= _MoveSpeedKey.Value;
                cmd.sidemove    *= _MoveSpeedKey.Value;
                cmd.upmove      *= _MoveSpeedKey.Value;
            }
        }
Esempio n. 3
0
        public void Clear()
        {
            movemessages = 0;
            cmd.Clear();
            Array.Clear(stats, 0, stats.Length);
            items = 0;
            Array.Clear(item_gettime, 0, item_gettime.Length);
            faceanimtime = 0;

            foreach (var cs in cshifts)
            {
                cs.Clear();
            }
            foreach (var cs in prev_cshifts)
            {
                cs.Clear();
            }

            mviewangles[0] = Vector3.Zero;
            mviewangles[1] = Vector3.Zero;
            viewangles     = Vector3.Zero;
            mvelocity[0]   = Vector3.Zero;
            mvelocity[1]   = Vector3.Zero;
            velocity       = Vector3.Zero;
            punchangle     = Vector3.Zero;

            idealpitch = 0;
            pitchvel   = 0;
            nodrift    = false;
            driftmove  = 0;
            laststop   = 0;

            viewheight = 0;
            crouch     = 0;

            paused   = false;
            onground = false;
            inwater  = false;

            intermission   = 0;
            completed_time = 0;

            mtime[0] = 0;
            mtime[1] = 0;
            time     = 0;
            oldtime  = 0;
            last_received_message = 0;

            Array.Clear(model_precache, 0, model_precache.Length);
            Array.Clear(sound_precache, 0, sound_precache.Length);

            levelname  = null;
            viewentity = 0;
            maxclients = 0;
            gametype   = 0;

            worldmodel   = null;
            free_efrags  = null;
            num_entities = 0;
            num_statics  = 0;
            viewent.Clear();

            cdtrack   = 0;
            looptrack = 0;

            scores = null;
        }
Esempio n. 4
0
        /// <summary>
        /// CL_BaseMove
        /// Send the intended movement message to the server
        /// </summary>
        static void BaseMove(ref usercmd_t cmd)
        {
            if (cls.signon != SIGNONS)
                return;

            AdjustAngles();

            cmd.Clear();

            if (ClientInput.StrafeBtn.IsDown)
            {
                cmd.sidemove += _SideSpeed.Value * KeyState(ref ClientInput.RightBtn);
                cmd.sidemove -= _SideSpeed.Value * KeyState(ref ClientInput.LeftBtn);
            }

            cmd.sidemove += _SideSpeed.Value * KeyState(ref ClientInput.MoveRightBtn);
            cmd.sidemove -= _SideSpeed.Value * KeyState(ref ClientInput.MoveLeftBtn);

            cmd.upmove += _UpSpeed.Value * KeyState(ref ClientInput.UpBtn);
            cmd.upmove -= _UpSpeed.Value * KeyState(ref ClientInput.DownBtn);

            if (!ClientInput.KLookBtn.IsDown)
            {
                cmd.forwardmove += _ForwardSpeed.Value * KeyState(ref ClientInput.ForwardBtn);
                cmd.forwardmove -= _BackSpeed.Value * KeyState(ref ClientInput.BackBtn);
            }

            //
            // adjust for speed key
            //
            if (ClientInput.SpeedBtn.IsDown)
            {
                cmd.forwardmove *= _MoveSpeedKey.Value;
                cmd.sidemove *= _MoveSpeedKey.Value;
                cmd.upmove *= _MoveSpeedKey.Value;
            }
        }