コード例 #1
0
        partial void pAfterDespawn()
        {
            this.inventory.ForEach(item =>
            {
                if (item.gVob != null)
                {
                    item.DeleteGVob();
                }
            });

            this.humanAI = null;
            this.gmodel  = null;
        }
コード例 #2
0
        /// <summary> Spawns the NPC in the given world at the given position & direction. </summary>
        public override void Spawn(World world, Vec3f position, Angles angles)
        {
            base.Spawn(world, position, angles);

            gVob.HP    = this.hp;
            gVob.HPMax = this.hpmax;

            gVob.InitHumanAI();
            this.humanAI = gVob.HumanAI;
            this.gmodel  = gVob.GetModel();

            // do detect walk stop chasm
            humanAI.Bitfield0 &= ~zCAIPlayer.Flags.DetectWalkChasm; // some shitty flag which makes npcs always check their ground

            if (this.hp <= 0)
            {
                gModel.StartAnimation("S_DEAD");
            }
        }