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

◆ SlopingCollision()

void Terraria.Player.SlopingCollision ( bool fallThrough,
bool ignorePlats )
inline

Definition at line 22001 of file Player.cs.

22002 {
22003 //IL_002b: Unknown result type (might be due to invalid IL or missing references)
22004 //IL_0031: Unknown result type (might be due to invalid IL or missing references)
22005 //IL_004e: Unknown result type (might be due to invalid IL or missing references)
22006 //IL_0053: Unknown result type (might be due to invalid IL or missing references)
22007 //IL_00cf: Unknown result type (might be due to invalid IL or missing references)
22008 //IL_00db: Unknown result type (might be due to invalid IL or missing references)
22009 //IL_00ec: Unknown result type (might be due to invalid IL or missing references)
22010 //IL_00fd: Unknown result type (might be due to invalid IL or missing references)
22011 //IL_010e: Unknown result type (might be due to invalid IL or missing references)
22012 //IL_0075: Unknown result type (might be due to invalid IL or missing references)
22013 //IL_00ab: Unknown result type (might be due to invalid IL or missing references)
22014 if (ignorePlats || controlDown || grappling[0] >= 0 || gravDir == -1f)
22015 {
22016 stairFall = true;
22017 }
22018 Vector4 vector = Collision.SlopeCollision(position, velocity, width, height, gravity, stairFall);
22019 if (Collision.stairFall)
22020 {
22021 stairFall = true;
22022 }
22023 else if (!fallThrough)
22024 {
22025 stairFall = false;
22026 }
22027 if (Collision.stair && Math.Abs(vector.Y - position.Y) > 8f + Math.Abs(velocity.X))
22028 {
22029 gfxOffY -= vector.Y - position.Y;
22030 stepSpeed = 4f;
22031 }
22032 _ = velocity;
22033 position.X = vector.X;
22034 position.Y = vector.Y;
22035 velocity.X = vector.Z;
22036 velocity.Y = vector.W;
22037 if (gravDir == -1f && velocity.Y == 0.0101f)
22038 {
22039 velocity.Y = 0f;
22040 }
22041 }
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
Definition Entity.cs:33
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
float stepSpeed
Definition Player.cs:1816
int[] grappling
Definition Player.cs:2840
float gfxOffY
An offset from the actual position of the player that will be added to the draw position....
Definition Player.cs:1814

References Terraria.Player.controlDown, Terraria.Player.gfxOffY, Terraria.Player.grappling, Terraria.Player.gravDir, Terraria.Player.gravity, Terraria.Entity.height, Terraria.Entity.position, Terraria.Collision.SlopeCollision(), Terraria.Collision.stair, Terraria.Collision.stairFall, Terraria.Player.stairFall, Terraria.Player.stepSpeed, Terraria.Entity.velocity, and Terraria.Entity.width.

Referenced by Terraria.Player.DryCollision(), and Terraria.Player.Update().

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