Terraria.TargetDummy.Place C# (CSharp) Method

Place() public static method

public static Place ( int x, int y ) : int
x int
y int
return int
        public static int Place(int x, int y)
        {
            int index1 = -1;
            for (int index2 = 0; index2 < 1000; ++index2)
            {
                if (TargetDummy.dummies[index2] == null)
                {
                    index1 = index2;
                    break;
                }
            }
            if (index1 == -1)
                return index1;
            TargetDummy.dummies[index1] = new TargetDummy(x, y);
            return index1;
        }

Usage Example

Beispiel #1
0
 public static int Hook_AfterPlacement(int x, int y, int type = 21, int style = 0, int direction = 1)
 {
     if (Main.netMode != 1)
         return TargetDummy.Place(x - 1, y - 2);
     NetMessage.SendTileSquare(Main.myPlayer, x - 1, y - 1, 3);
     NetMessage.SendData(87, -1, -1, "", x - 1, (float)(y - 2), 0.0f, 0.0f, 0, 0, 0);
     return -1;
 }
All Usage Examples Of Terraria.TargetDummy::Place