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

◆ ChangeDir()

void Terraria.Player.ChangeDir ( int dir)
inline

Definition at line 40136 of file Player.cs.

40137 {
40138 if (!pulley || pulleyDir != 2)
40139 {
40140 direction = dir;
40141 }
40142 else
40143 {
40144 if (pulleyDir == 2 && dir == direction)
40145 {
40146 return;
40147 }
40148 int num = (int)(position.X + (float)(width / 2)) / 16 * 16 + 8 - width / 2;
40149 if (!Collision.SolidCollision(new Vector2(num, position.Y), width, height))
40150 {
40151 if (whoAmI == Main.myPlayer)
40152 {
40153 Main.cameraX = Main.cameraX + position.X - (float)num;
40154 }
40155 pulleyDir = 1;
40156 position.X = num;
40157 direction = dir;
40158 }
40159 }
40160 }
Vector2 position
Definition Entity.cs:14

References Terraria.Main.myPlayer, and Terraria.Collision.SolidCollision().

Referenced by Terraria.Projectile.AI_015_Flails(), Terraria.Projectile.AI_075(), Terraria.Projectile.AI_100_Medusa(), Terraria.Projectile.AI_140_MonkStaffT1(), Terraria.Projectile.AI_150_GolfClubHelper(), Terraria.Projectile.AI_160_Kites(), Terraria.GameContent.PlayerSittingHelper.SitDown(), and Terraria.GameContent.PlayerSleepingHelper.StartSleeping().