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

◆ CanMoveForwardOnRope()

bool Terraria.Player.CanMoveForwardOnRope ( int dir,
int x,
int y )
inlineprivate

Definition at line 22572 of file Player.cs.

22573 {
22574 //IL_00f1: Unknown result type (might be due to invalid IL or missing references)
22575 int num = x + dir;
22576 if (Main.tile[num, y] != null && Main.tile[num, y].active() && Main.tileRope[Main.tile[num, y].type])
22577 {
22578 int num2 = num * 16 + 8 - width / 2;
22579 float y2 = position.Y;
22580 y2 = y * 16 + 22;
22581 if ((!Main.tile[num, y - 1].active() || !Main.tileRope[Main.tile[num, y - 1].type]) && (!Main.tile[num, y + 1].active() || !Main.tileRope[Main.tile[num, y + 1].type]))
22582 {
22583 y2 = y * 16 + 22;
22584 }
22585 if (Collision.SolidCollision(new Vector2((float)num2, y2), width, height))
22586 {
22587 return false;
22588 }
22589 return true;
22590 }
22591 return false;
22592 }
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

References Terraria.Entity.height, Terraria.Entity.position, Terraria.Collision.SolidCollision(), Terraria.Main.tile, Terraria.Main.tileRope, and Terraria.Entity.width.

Referenced by Terraria.Player.Update().

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