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

◆ QuickMinecart()

void Terraria.Player.QuickMinecart ( )
inlineprivate

Definition at line 6343 of file Player.cs.

6344 {
6345 //IL_00cd: Unknown result type (might be due to invalid IL or missing references)
6346 //IL_00d7: Unknown result type (might be due to invalid IL or missing references)
6347 //IL_00dc: Unknown result type (might be due to invalid IL or missing references)
6348 //IL_00e1: Unknown result type (might be due to invalid IL or missing references)
6349 //IL_00eb: Unknown result type (might be due to invalid IL or missing references)
6350 //IL_00f0: Unknown result type (might be due to invalid IL or missing references)
6351 //IL_010d: Unknown result type (might be due to invalid IL or missing references)
6352 //IL_011f: Unknown result type (might be due to invalid IL or missing references)
6353 //IL_0124: Unknown result type (might be due to invalid IL or missing references)
6354 //IL_0126: Unknown result type (might be due to invalid IL or missing references)
6355 //IL_012d: Unknown result type (might be due to invalid IL or missing references)
6356 //IL_0203: Unknown result type (might be due to invalid IL or missing references)
6357 //IL_020f: Unknown result type (might be due to invalid IL or missing references)
6358 //IL_015d: Unknown result type (might be due to invalid IL or missing references)
6359 //IL_0162: Unknown result type (might be due to invalid IL or missing references)
6360 //IL_016c: Unknown result type (might be due to invalid IL or missing references)
6361 //IL_0176: Unknown result type (might be due to invalid IL or missing references)
6362 //IL_017b: Unknown result type (might be due to invalid IL or missing references)
6363 //IL_0180: Unknown result type (might be due to invalid IL or missing references)
6364 //IL_01d9: Unknown result type (might be due to invalid IL or missing references)
6365 //IL_018c: Unknown result type (might be due to invalid IL or missing references)
6366 //IL_0196: Unknown result type (might be due to invalid IL or missing references)
6367 //IL_019b: Unknown result type (might be due to invalid IL or missing references)
6368 //IL_01a5: Unknown result type (might be due to invalid IL or missing references)
6369 //IL_01af: Unknown result type (might be due to invalid IL or missing references)
6370 //IL_01b4: Unknown result type (might be due to invalid IL or missing references)
6371 //IL_01c1: Unknown result type (might be due to invalid IL or missing references)
6372 //IL_01c8: Unknown result type (might be due to invalid IL or missing references)
6373 int num = 0;
6374 int value5 = (int)(position.X / 16f) - tileRangeX - num + 1;
6375 int value2 = (int)((position.X + (float)width) / 16f) + tileRangeX + num - 1;
6376 int value3 = (int)(position.Y / 16f) - tileRangeY - num + 1;
6377 int value4 = (int)((position.Y + (float)height) / 16f) + tileRangeY + num - 2;
6378 int num2 = Utils.Clamp(value5, 10, Main.maxTilesX - 10);
6379 value2 = Utils.Clamp(value2, 10, Main.maxTilesX - 10);
6380 value3 = Utils.Clamp(value3, 10, Main.maxTilesY - 10);
6381 List<Point> list = Collision.GetTilesIn(BottomRight: new Vector2((float)(value2 + 1), (float)(Utils.Clamp(value4, 10, Main.maxTilesY - 10) + 1)) * 16f, TopLeft: new Vector2((float)num2, (float)value3) * 16f);
6382 if (list.Count <= 0)
6383 {
6384 return;
6385 }
6386 Point? point = null;
6387 _ = base.Hitbox;
6388 for (int i = 0; i < list.Count; i++)
6389 {
6390 Point point2 = list[i];
6391 Tile tileSafely = Framing.GetTileSafely(point2.X, point2.Y);
6392 if (tileSafely.active() && tileSafely.type == 314)
6393 {
6394 Vector2 vector = list[i].ToVector2() * 16f + new Vector2(8f);
6395 if (!point.HasValue || (Distance(vector) < Distance(point.Value.ToVector2() * 16f + new Vector2(8f)) && Collision.CanHitLine(base.Center, 0, 0, vector, 0, 0)))
6396 {
6397 point = list[i];
6398 }
6399 }
6400 }
6401 if (point.HasValue)
6402 {
6403 LaunchMinecartHook(point.Value.X, point.Value.Y);
6404 }
6405 }
Vector2 BottomRight
Definition Entity.cs:204
Vector2 TopLeft
Definition Entity.cs:138
float Distance(Vector2 Other)
Definition Entity.cs:275
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
int width
The width of this Entity's hitbox, in pixels.
Definition Entity.cs:46
int height
The height of this Entity's hitbox, in pixels.
Definition Entity.cs:51
void LaunchMinecartHook(int myX, int myY)
Definition Player.cs:31735
static int tileRangeX
Definition Player.cs:2642
static int tileRangeY
Definition Player.cs:2644

References Terraria.Entity.BottomRight, Terraria.Collision.CanHitLine(), Terraria.Entity.Distance(), Terraria.Framing.GetTileSafely(), Terraria.Collision.GetTilesIn(), Terraria.Entity.height, Terraria.Player.LaunchMinecartHook(), Terraria.Main.maxTilesX, Terraria.Main.maxTilesY, Terraria.Entity.position, Terraria.Player.tileRangeX, Terraria.Player.tileRangeY, Terraria.Entity.TopLeft, and Terraria.Entity.width.

Referenced by Terraria.Player.QuickMount().

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