3570 {
3581 int num = -1;
3585 int num5 = Utils.Clamp(
value, 0, Main.maxTilesX - 1);
3592 {
3594 {
3595 Tile tile = Main.tile[
i,
j];
3596 if (tile ==
null || !tile.active() || tile.inActive() ||
forcedIgnoredTiles[tile.type] || (!Main.tileSolid[tile.type] && (!Main.tileSolidTop[tile.type] || tile.frameY != 0)))
3597 {
3598 continue;
3599 }
3603 if (tile.halfBrick())
3604 {
3605 vector4.Y += 8f;
3607 }
3609 {
3610 continue;
3611 }
3612 bool flag = false;
3614 if (tile.slope() > 2)
3615 {
3616 if (tile.slope() == 3 && vector3.Y +
Math.
Abs(Velocity.X) >= vector4.Y && vector3.X >=
vector4.X)
3617 {
3619 }
3620 if (tile.slope() == 4 && vector3.Y +
Math.
Abs(Velocity.X) >= vector4.Y && vector3.X + (float)Width <=
vector4.X + 16f)
3621 {
3623 }
3624 }
3625 else if (tile.slope() > 0)
3626 {
3627 flag = true;
3628 if (tile.slope() == 1 && vector3.Y + (float)Height -
Math.
Abs(Velocity.X) <= vector4.Y + (float)
num7 &&
vector3.X >=
vector4.X)
3629 {
3631 }
3632 if (tile.slope() == 2 && vector3.Y + (float)Height -
Math.
Abs(Velocity.X) <= vector4.Y + (float)
num7 &&
vector3.X + (
float)Width <= vector4.X + 16f)
3633 {
3635 }
3636 }
3638 {
3639 continue;
3640 }
3642 {
3645 {
3649 {
3651 }
3652 if (
num3 != num && !flag)
3653 {
3654 result.Y = vector4.Y - (vector3.Y + (float)Height) + ((gravDir == -1) ? (-0.01f) : 0f);
3656 }
3657 }
3658 }
3659 else if (
vector3.X + (
float)Width <= vector4.X && !Main.tileSolidTop[tile.type])
3660 {
3661 if (Main.tile[i - 1,
j] ==
null)
3662 {
3663 Main.tile[
i - 1,
j] =
new Tile();
3664 }
3665 if (Main.tile[i - 1,
j].slope() != 2 && Main.tile[i - 1,
j].slope() != 4)
3666 {
3670 {
3671 result.X = vector4.X - (vector3.X + (float)Width);
3672 }
3674 {
3676 }
3677 }
3678 }
3679 else if (
vector3.X >=
vector4.X + 16f && !Main.tileSolidTop[tile.type])
3680 {
3681 if (Main.tile[i + 1,
j] ==
null)
3682 {
3683 Main.tile[
i + 1,
j] =
new Tile();
3684 }
3685 if (Main.tile[i + 1,
j].slope() != 1 && Main.tile[i + 1,
j].slope() != 3)
3686 {
3690 {
3691 result.X = vector4.X + 16f -
vector3.X;
3692 }
3694 {
3696 }
3697 }
3698 }
3700 {
3704 result.Y = vector4.Y + (float)
num7 -
vector3.Y + ((gravDir == 1) ? 0.01f : 0f);
3706 {
3708 }
3709 }
3710 }
3711 }
3712 return result;
3713 }
static double Abs(double value)