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

◆ QuickMinecartSnap()

bool Terraria.Player.QuickMinecartSnap ( )
inlineprivate

Definition at line 6407 of file Player.cs.

6408 {
6409 //IL_0003: Unknown result type (might be due to invalid IL or missing references)
6410 //IL_000d: Unknown result type (might be due to invalid IL or missing references)
6411 //IL_0012: Unknown result type (might be due to invalid IL or missing references)
6412 //IL_0018: Unknown result type (might be due to invalid IL or missing references)
6413 //IL_0022: Unknown result type (might be due to invalid IL or missing references)
6414 //IL_0027: Unknown result type (might be due to invalid IL or missing references)
6415 //IL_0047: Unknown result type (might be due to invalid IL or missing references)
6416 //IL_0056: Unknown result type (might be due to invalid IL or missing references)
6417 //IL_005b: Unknown result type (might be due to invalid IL or missing references)
6418 //IL_005d: Unknown result type (might be due to invalid IL or missing references)
6419 //IL_0064: Unknown result type (might be due to invalid IL or missing references)
6420 //IL_0132: Unknown result type (might be due to invalid IL or missing references)
6421 //IL_013e: Unknown result type (might be due to invalid IL or missing references)
6422 //IL_0092: Unknown result type (might be due to invalid IL or missing references)
6423 //IL_0097: Unknown result type (might be due to invalid IL or missing references)
6424 //IL_00a1: Unknown result type (might be due to invalid IL or missing references)
6425 //IL_00ab: Unknown result type (might be due to invalid IL or missing references)
6426 //IL_00b0: Unknown result type (might be due to invalid IL or missing references)
6427 //IL_00b5: Unknown result type (might be due to invalid IL or missing references)
6428 //IL_010c: Unknown result type (might be due to invalid IL or missing references)
6429 //IL_00c1: Unknown result type (might be due to invalid IL or missing references)
6430 //IL_00cb: Unknown result type (might be due to invalid IL or missing references)
6431 //IL_00d0: Unknown result type (might be due to invalid IL or missing references)
6432 //IL_00da: Unknown result type (might be due to invalid IL or missing references)
6433 //IL_00e4: Unknown result type (might be due to invalid IL or missing references)
6434 //IL_00e9: Unknown result type (might be due to invalid IL or missing references)
6435 //IL_00f6: Unknown result type (might be due to invalid IL or missing references)
6436 //IL_00fd: Unknown result type (might be due to invalid IL or missing references)
6437 bool result = false;
6438 List<Point> tilesIn = Collision.GetTilesIn(base.TopLeft - new Vector2(24f), base.BottomRight + new Vector2(24f));
6439 if (tilesIn.Count > 0)
6440 {
6441 Point? point = null;
6442 _ = base.Hitbox;
6443 for (int i = 0; i < tilesIn.Count; i++)
6444 {
6445 Point point2 = tilesIn[i];
6446 Tile tileSafely = Framing.GetTileSafely(point2.X, point2.Y);
6447 if (tileSafely.active() && tileSafely.type == 314)
6448 {
6449 Vector2 vector = tilesIn[i].ToVector2() * 16f + new Vector2(8f);
6450 if (!point.HasValue || (Distance(vector) < Distance(point.Value.ToVector2() * 16f + new Vector2(8f)) && Collision.CanHitLine(base.Center, 0, 0, vector, 0, 0)))
6451 {
6452 point = tilesIn[i];
6453 }
6454 }
6455 }
6456 if (point.HasValue)
6457 {
6458 LaunchMinecartHook(point.Value.X, point.Value.Y);
6459 result = true;
6460 }
6461 }
6462 return result;
6463 }
float Distance(Vector2 Other)
Definition Entity.cs:275
void LaunchMinecartHook(int myX, int myY)
Definition Player.cs:31735

References Terraria.Collision.CanHitLine(), Terraria.Entity.Distance(), Terraria.Framing.GetTileSafely(), Terraria.Collision.GetTilesIn(), and Terraria.Player.LaunchMinecartHook().

Referenced by Terraria.Player.QuickMount().

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