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

◆ UpdateTouchingTiles()

void Terraria.Player.UpdateTouchingTiles ( )
inline

Definition at line 53670 of file Player.cs.

53671 {
53673 List<Point> list = null;
53674 List<Point> list2 = null;
53675 if (!Collision.IsClearSpotTest(position + velocity, 16f, width, height, fallThrough: false, fall2: false, (int)gravDir, checkCardinals: true, checkSlopes: true))
53676 {
53677 list = Collision.FindCollisionTile((Math.Sign(velocity.Y) == 1) ? 2 : 3, position + velocity, 16f, width, height, fallThrough: false, fall2: false, (int)gravDir);
53678 }
53679 if (!Collision.IsClearSpotTest(position, Math.Abs(velocity.Y), width, height, fallThrough: false, fall2: false, (int)gravDir, checkCardinals: true, checkSlopes: true))
53680 {
53681 list2 = Collision.FindCollisionTile((Math.Sign(velocity.Y) == 1) ? 2 : 3, position, Math.Abs(velocity.Y), width, height, fallThrough: false, fall2: false, (int)gravDir, checkCardinals: true, checkSlopes: true);
53682 }
53683 if (list != null && list2 != null)
53684 {
53685 for (int i = 0; i < list2.Count; i++)
53686 {
53687 if (!list.Contains(list2[i]))
53688 {
53689 list.Add(list2[i]);
53690 }
53691 }
53692 }
53693 if (list == null && list2 != null)
53694 {
53695 list = list2;
53696 }
53697 if (list != null)
53698 {
53700 }
53701 }
void Add(TKey key, TValue value)
static double Abs(double value)
static int Sign(decimal value)
Definition Math.cs:1202
Vector2 velocity
Definition Entity.cs:16
Vector2 position
Definition Entity.cs:14
List< Point > TouchedTiles
Definition Player.cs:2563

References System.Math.Abs(), System.Collections.Generic.Dictionary< TKey, TValue >.Clear(), System.Collections.Generic.Dictionary< TKey, TValue >.Count, Terraria.Collision.FindCollisionTile(), Terraria.Collision.IsClearSpotTest(), System.list, and System.Math.Sign().