Пример #1
0
        public override void OnKilled()
        {
            if (LifeState == LifeState.Dead)
            {
                return;
            }

            LifeState = LifeState.Dead;

            Log.Info("Pawn got killed");

            var ragdoll = CreateRagdoll(LastDamage.Force, GetHitboxBone(LastDamage.HitboxIndex));

            ClearCollisionLayers();
            EnableDrawing = false;

            Ragdoll   = ragdoll;
            DeathTime = 0;

            // NOTE: This pawn/entity will keep existing until the round manager decides otherwise.
            var roundMgr = RoundManager.Get();

            if (roundMgr != null)
            {
                roundMgr?.OnPawnKilled(this);
            }

            base.OnKilled();
        }
Пример #2
0
        public override void BuildInput(InputBuilder input)
        {
            var roundMgr = RoundManager.Get();

            if (roundMgr != null && !roundMgr.CanPawnMove(this.Pawn as Pawn))
            {
                input.Clear();
                input.ClearButtons();
            }
            else
            {
                base.BuildInput(input);
            }
        }