1581 {
1584 bool[]
array =
new bool[5];
1595 int num = Utils.Clamp(
value, 0, Main.maxTilesX - 1);
1601 {
1603 {
1604 if (Main.tile[i,
j] ==
null || !Main.tile[i,
j].active() || Main.tile[
i,
j].inActive() || (!Main.tileSolid[Main.tile[
i,
j].type] && (!Main.tileSolidTop[Main.tile[
i,
j].type] || Main.tile[
i,
j].frameY != 0)))
1605 {
1606 continue;
1607 }
1611 if (Main.tile[i,
j].halfBrick())
1612 {
1613 vector4.Y += 8f;
1615 }
1617 {
1618 continue;
1619 }
1620 bool flag = true;
1622 {
1623 if (Velocity.
Y < 0f)
1624 {
1625 flag = false;
1626 }
1627 if (
Position.Y + (
float)Height < (float)(
j * 16) || Position.Y + (float)Height - (1f +
Math.
Abs(Velocity.
X)) > (
float)(
j * 16 + 16))
1628 {
1629 flag = false;
1630 }
1631 if (((Main.tile[i,
j].slope() == 1 && Velocity.X >= 0f) || (Main.tile[i,
j].slope() == 2 && Velocity.X <= 0f)) && (Position.Y + (float)Height) / 16f - 1f == (float)
j)
1632 {
1633 flag = false;
1634 }
1635 }
1636 if (!flag)
1637 {
1638 continue;
1639 }
1642 {
1644 }
1645 int num3 = Main.tile[
i,
j].slope();
1649 {
1650 continue;
1651 }
1654 {
1656 {
1658 }
1660 {
1661 num4 = vector4.X + 16f - (Position.X + (float)Width);
1662 }
1664 {
1666 {
1667 float num5 = vector4.Y + 16f - vector.Y -
num4;
1669 {
1670 vector2.Y = Position.Y +
num5;
1673 {
1674 vector3.Y = 0.0101f;
1675 }
1677 }
1678 }
1679 }
1681 {
1682 float num6 = vector4.Y + 16f;
1684 {
1687 {
1688 vector3.Y = 0.0101f;
1689 }
1690 }
1691 }
1692 }
1694 {
1695 continue;
1696 }
1698 {
1700 }
1702 {
1703 num4 = vector4.X + 16f - (Position.X + (float)Width);
1704 }
1706 {
1708 {
1709 continue;
1710 }
1711 float num7 = vector4.Y - (vector.Y + (float)Height) +
num4;
1713 {
1714 continue;
1715 }
1717 {
1719 continue;
1720 }
1722 {
1724 }
1725 else
1726 {
1728 }
1729 vector2.Y = Position.Y +
num7;
1732 {
1733 vector3.Y = 0f;
1734 }
1736 continue;
1737 }
1739 {
1741 {
1743 }
1744 continue;
1745 }
1746 float num8 = vector4.Y - (float)Height;
1748 {
1749 continue;
1750 }
1752 {
1754 continue;
1755 }
1757 {
1759 }
1760 else
1761 {
1763 }
1766 {
1767 vector3.Y = 0f;
1768 }
1769 }
1770 }
1775 {
1777 vector2.Y = Position.Y +
vector5.Y;
1779 {
1780 vector2.X = Position.X -
num9;
1781 }
1783 {
1784 vector2.X = Position.X +
num9;
1785 }
1786 vector3.X = 0f;
1787 vector3.Y = 0f;
1789 }
1791 {
1792 float num10 = vector5.Y - velocity.
Y;
1793 vector2.Y = Position.Y +
vector5.Y;
1795 {
1796 vector2.X = Position.X -
num10;
1797 }
1799 {
1800 vector2.X = Position.X +
num10;
1801 }
1802 vector3.X = 0f;
1803 vector3.Y = 0f;
1804 }
1806 }
static double Abs(double value)
static Vector2 TileCollision(Vector2 Position, Vector2 Velocity, int Width, int Height, bool fallThrough=false, bool fall2=false, int gravDir=1)