Terraria.Player.UpdatePetLight C# (CSharp) Method

UpdatePetLight() public method

public UpdatePetLight ( int i ) : void
i int
return void
        public void UpdatePetLight(int i)
        {
            if (i != Main.myPlayer || this.miscEquips[1].buffType < 1 || this.miscEquips[1].stack < 1)
                return;
            int type = this.miscEquips[1].buffType;
            if (!Main.vanityPet[type] && !Main.lightPet[type] || this.hideMisc[1] || this.miscEquips[1].itemId == 603 && !Main.cEd)
                return;
            int num = this.HasBuff(type);
            if (type == 27 && num == -1)
                num = this.HasBuff(102);
            if (type == 27 && num == -1)
                num = this.HasBuff(101);
            if (num != -1)
                return;
            if (type == 27)
                type = Utils.SelectRandom<int>(Main.rand, 27, 102, 101);
            this.AddBuff(type, 3600, true);
            Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, this.miscEquips[1].useSound);
        }
Player