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

◆ Collision_MoveSnailOnSlopes()

void Terraria.NPC.Collision_MoveSnailOnSlopes ( )
inlineprivate

Definition at line 109830 of file NPC.cs.

109831 {
109832 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
109833 //IL_0007: Unknown result type (might be due to invalid IL or missing references)
109834 //IL_001f: Unknown result type (might be due to invalid IL or missing references)
109835 //IL_0024: Unknown result type (might be due to invalid IL or missing references)
109836 //IL_0030: Unknown result type (might be due to invalid IL or missing references)
109837 //IL_0043: Unknown result type (might be due to invalid IL or missing references)
109838 //IL_00e6: Unknown result type (might be due to invalid IL or missing references)
109839 //IL_00f7: Unknown result type (might be due to invalid IL or missing references)
109840 //IL_0108: Unknown result type (might be due to invalid IL or missing references)
109841 //IL_0119: Unknown result type (might be due to invalid IL or missing references)
109842 Vector4 vector = Collision.SlopeCollision(position, velocity, width, height, gravity);
109843 if (position.X != vector.X || position.Y != vector.Y)
109844 {
109845 if (ai[2] == 0f && velocity.Y > 0f && ((direction < 0 && rotation == 1.57f && spriteDirection == 1) || (direction > 0 && rotation == 4.71f && spriteDirection == -1)))
109846 {
109847 direction *= -direction;
109848 }
109849 ai[2] = 2f;
109850 directionY = 1;
109851 rotation = 0f;
109852 }
109853 position.X = vector.X;
109854 position.Y = vector.Y;
109855 velocity.X = vector.Z;
109856 velocity.Y = vector.W;
109857 }
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
int spriteDirection
Definition NPC.cs:1143
float gravity
The current change in velocity due to gravity applied every frame. Multiply F:Terraria....
Definition NPC.cs:1619
float[] ai
An array with 4 slots used for any sort of data storage, which is occasionally synced from the server...
Definition NPC.cs:997
float rotation
Definition NPC.cs:1116
int directionY
Definition NPC.cs:983

References Terraria.Collision.SlopeCollision().

+ Here is the call graph for this function: