TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ PlaceThing_Walls_FillEmptySpace()

void Terraria.Player.PlaceThing_Walls_FillEmptySpace ( )
inlineprivate

Definition at line 38432 of file Player.cs.

38433 {
38434 if (inventory[selectedItem].stack <= 1)
38435 {
38436 return;
38437 }
38438 int createWall = inventory[selectedItem].createWall;
38439 for (int i = 0; i < 4; i++)
38440 {
38441 int num = tileTargetX;
38442 int num2 = tileTargetY;
38443 if (i == 0)
38444 {
38445 num--;
38446 }
38447 if (i == 1)
38448 {
38449 num++;
38450 }
38451 if (i == 2)
38452 {
38453 num2--;
38454 }
38455 if (i == 3)
38456 {
38457 num2++;
38458 }
38459 if (Main.tile[num, num2].wall != 0)
38460 {
38461 continue;
38462 }
38463 int num3 = 0;
38464 for (int j = 0; j < 4; j++)
38465 {
38466 int num4 = num;
38467 int num5 = num2;
38468 if (j == 0)
38469 {
38470 num4--;
38471 }
38472 if (j == 1)
38473 {
38474 num4++;
38475 }
38476 if (j == 2)
38477 {
38478 num5--;
38479 }
38480 if (j == 3)
38481 {
38482 num5++;
38483 }
38484 if (Main.tile[num4, num5].wall == createWall)
38485 {
38486 num3++;
38487 }
38488 }
38489 if (num3 != 4)
38490 {
38491 continue;
38492 }
38493 WorldGen.PlaceWall(num, num2, createWall);
38494 if (Main.tile[num, num2].wall == createWall)
38495 {
38497 {
38499 }
38500 if (inventory[selectedItem].stack == 0)
38501 {
38503 }
38504 if (Main.netMode == 1)
38505 {
38506 NetMessage.SendData(17, -1, -1, null, 3, num, num2, createWall);
38507 }
38508 if (autoPaint && builderAccStatus[3] == 0)
38509 {
38511 }
38512 }
38513 }
38514 }
int stack
The current stack of the item. F:Terraria.Item.maxStack indicates the max possible stack.
Definition Item.cs:396
int createWall
The ID of the wall this item places on use. Either a T:Terraria.ID.WallID entry or M:Terraria....
Definition Item.cs:441
void SetDefaults(int Type=0)
Definition Item.cs:48800
static bool ConsumeItem(Item item, Player player)
If ModItem.ConsumeItem or any of the GlobalItem.ConsumeItem hooks returns false, sets consume to fals...
This serves as the central class from which item-related functions are carried out....
Definition ItemLoader.cs:26
void TryPainting(int x, int y, bool paintingAWall=false, bool applyItemAnimation=true)
Definition Player.cs:40659
static int tileTargetY
Definition Player.cs:2652
static int tileTargetX
Definition Player.cs:2650
int[] builderAccStatus
Definition Player.cs:1007
Item[] inventory
The player's normal inventory. Indexes 0-9 hold the hotbar items, 10-49 the rest of the main inventor...
Definition Player.cs:1767

References Terraria.Player.autoPaint, Terraria.Player.builderAccStatus, Terraria.ModLoader.ItemLoader.ConsumeItem(), Terraria.Item.createWall, Terraria.Player.inventory, Terraria.Main.netMode, Terraria.WorldGen.PlaceWall(), Terraria.Player.selectedItem, Terraria.NetMessage.SendData(), Terraria.Item.SetDefaults(), Terraria.Item.stack, Terraria.Main.tile, Terraria.Player.tileTargetX, Terraria.Player.tileTargetY, and Terraria.Player.TryPainting().

Referenced by Terraria.Player.PlaceThing_Walls().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: