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

◆ CanMoveForwardOnRope()

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

Definition at line 23253 of file Player.cs.

23254 {
23255 int num = x + dir;
23256 if (Main.tile[num, y] != null && Main.tile[num, y].active() && Main.tileRope[Main.tile[num, y].type])
23257 {
23258 int num2 = num * 16 + 8 - width / 2;
23259 float y2 = position.Y;
23260 y2 = y * 16 + 22;
23261 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]))
23262 {
23263 y2 = y * 16 + 22;
23264 }
23265 if (Collision.SolidCollision(new Vector2(num2, y2), width, height))
23266 {
23267 return false;
23268 }
23269 return true;
23270 }
23271 return false;
23272 }
Vector2 position
Definition Entity.cs:14

References Terraria.Collision.SolidCollision(), Terraria.Main.tile, and Terraria.Main.tileRope.