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

◆ PlaceThing_Tiles_BlockPlacementIfOverPlayers()

static void Terraria.Player.PlaceThing_Tiles_BlockPlacementIfOverPlayers ( ref bool canPlace,
ref TileObject data )
inlinestaticprivate

Definition at line 40171 of file Player.cs.

40172 {
40173 //IL_0122: Unknown result type (might be due to invalid IL or missing references)
40174 //IL_0127: Unknown result type (might be due to invalid IL or missing references)
40175 //IL_012b: Unknown result type (might be due to invalid IL or missing references)
40176 int num = 0;
40177 int num2 = 0;
40178 int x = 0;
40179 int y = 0;
40180 switch (data.type)
40181 {
40182 case 138:
40183 case 664:
40184 num = 32;
40185 num2 = 32;
40186 x = data.xCoord * 16;
40187 y = data.yCoord * 16;
40188 break;
40189 case 484:
40190 num = 32;
40191 num2 = 32;
40192 x = data.xCoord * 16;
40193 y = data.yCoord * 16;
40194 break;
40195 case 235:
40196 num = 48;
40197 num2 = 16;
40198 x = data.xCoord * 16;
40199 y = data.yCoord * 16;
40200 break;
40201 case 476:
40202 num = 16;
40203 num2 = 16;
40204 x = data.xCoord * 16;
40205 y = data.yCoord * 16;
40206 break;
40207 case 387:
40208 num = 32;
40209 num2 = 16;
40210 x = data.xCoord * 16;
40211 y = data.yCoord * 16;
40212 break;
40213 }
40214 if (num == 0 || num2 == 0)
40215 {
40216 return;
40217 }
40218 Rectangle value = default(Rectangle);
40219 ((Rectangle)(ref value))._002Ector(x, y, num, num2);
40220 for (int i = 0; i < 255; i++)
40221 {
40222 Player player = Main.player[i];
40223 if (player.active && !player.dead && !player.ghost)
40224 {
40225 Rectangle hitbox = player.Hitbox;
40226 if (((Rectangle)(ref hitbox)).Intersects(value))
40227 {
40228 canPlace = false;
40229 break;
40230 }
40231 }
40232 }
40233 }

References Terraria.Entity.active, Terraria.Player.dead, Terraria.Player.ghost, Terraria.Entity.Hitbox, and Terraria.Main.player.

Referenced by Terraria.Player.PlaceThing_Tiles().

+ Here is the caller graph for this function: