Terraria.Player.ChangeSpawn C# (CSharp) Method

ChangeSpawn() public method

public ChangeSpawn ( int x, int y ) : void
x int
y int
return void
        public void ChangeSpawn(int x, int y)
        {
            for (int index1 = 0; index1 < 200 && this.spN[index1] != null; ++index1)
            {
                if (this.spN[index1] == Main.worldName && this.spI[index1] == Main.worldID)
                {
                    for (int index2 = index1; index2 > 0; --index2)
                    {
                        this.spN[index2] = this.spN[index2 - 1];
                        this.spI[index2] = this.spI[index2 - 1];
                        this.spX[index2] = this.spX[index2 - 1];
                        this.spY[index2] = this.spY[index2 - 1];
                    }
                    this.spN[0] = Main.worldName;
                    this.spI[0] = Main.worldID;
                    this.spX[0] = x;
                    this.spY[0] = y;
                    return;
                }
            }
            for (int index = 199; index > 0; --index)
            {
                if (this.spN[index - 1] != null)
                {
                    this.spN[index] = this.spN[index - 1];
                    this.spI[index] = this.spI[index - 1];
                    this.spX[index] = this.spX[index - 1];
                    this.spY[index] = this.spY[index - 1];
                }
            }
            this.spN[0] = Main.worldName;
            this.spI[0] = Main.worldID;
            this.spX[0] = x;
            this.spY[0] = y;
        }
Player