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

◆ HitTiles()

static void Terraria.Collision.HitTiles ( Vector2 Position,
Vector2 Velocity,
int Width,
int Height )
inlinestatic

Definition at line 3526 of file Collision.cs.

3527 {
3528 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
3529 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
3530 //IL_0002: Unknown result type (might be due to invalid IL or missing references)
3531 //IL_0007: Unknown result type (might be due to invalid IL or missing references)
3532 //IL_0008: Unknown result type (might be due to invalid IL or missing references)
3533 //IL_0018: Unknown result type (might be due to invalid IL or missing references)
3534 //IL_002b: Unknown result type (might be due to invalid IL or missing references)
3535 //IL_003b: Unknown result type (might be due to invalid IL or missing references)
3536 //IL_007b: Unknown result type (might be due to invalid IL or missing references)
3537 //IL_018f: Unknown result type (might be due to invalid IL or missing references)
3538 //IL_0198: Unknown result type (might be due to invalid IL or missing references)
3539 //IL_01a1: Unknown result type (might be due to invalid IL or missing references)
3540 //IL_01a7: Unknown result type (might be due to invalid IL or missing references)
3541 //IL_01b6: Unknown result type (might be due to invalid IL or missing references)
3542 //IL_01bf: Unknown result type (might be due to invalid IL or missing references)
3543 //IL_01c8: Unknown result type (might be due to invalid IL or missing references)
3544 //IL_01ce: Unknown result type (might be due to invalid IL or missing references)
3545 Vector2 vector = Position + Velocity;
3546 int num = (int)(Position.X / 16f) - 1;
3547 int num2 = (int)((Position.X + (float)Width) / 16f) + 2;
3548 int num3 = (int)(Position.Y / 16f) - 1;
3549 int num4 = (int)((Position.Y + (float)Height) / 16f) + 2;
3550 if (num < 0)
3551 {
3552 num = 0;
3553 }
3554 if (num2 > Main.maxTilesX)
3555 {
3556 num2 = Main.maxTilesX;
3557 }
3558 if (num3 < 0)
3559 {
3560 num3 = 0;
3561 }
3562 if (num4 > Main.maxTilesY)
3563 {
3564 num4 = Main.maxTilesY;
3565 }
3566 Vector2 vector2 = default(Vector2);
3567 for (int i = num; i < num2; i++)
3568 {
3569 for (int j = num3; j < num4; j++)
3570 {
3571 if (Main.tile[i, j] != null && !Main.tile[i, j].inActive() && Main.tile[i, j].active() && (Main.tileSolid[Main.tile[i, j].type] || (Main.tileSolidTop[Main.tile[i, j].type] && Main.tile[i, j].frameY == 0)))
3572 {
3573 vector2.X = i * 16;
3574 vector2.Y = j * 16;
3575 int num5 = 16;
3576 if (Main.tile[i, j].halfBrick())
3577 {
3578 vector2.Y += 8f;
3579 num5 -= 8;
3580 }
3581 if (vector.X + (float)Width >= vector2.X && vector.X <= vector2.X + 16f && vector.Y + (float)Height >= vector2.Y && vector.Y <= vector2.Y + (float)num5)
3582 {
3583 WorldGen.KillTile(i, j, fail: true, effectOnly: true);
3584 }
3585 }
3586 }
3587 }
3588 }

References Terraria.WorldGen.KillTile(), Terraria.Main.maxTilesX, Terraria.Main.maxTilesY, Terraria.Main.tile, Terraria.Main.tileSolid, and Terraria.Main.tileSolidTop.

Referenced by Terraria.Projectile.AI_015_HandleMovementCollision(), Terraria.Projectile.AI_015_HandleMovementCollision_Old(), Terraria.Projectile.HandleMovement(), and Terraria.Projectile.Kill().

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