Skip to content

Commit

Permalink
Fix #2613, ChangeDir now updates itemRotation correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Chicken-Bones committed Oct 12, 2023
1 parent a708700 commit 05f30a6
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions patches/tModLoader/Terraria/Player.cs.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5757,6 +5757,35 @@
if (num8 > 0)
DropItemFromExtractinator(num8, num9);
}
@@ -32784,6 +_,10 @@

public void ChangeDir(int dir)
{
+ // added by TML, forward port from 1.4.5
+ if (dir == direction)
+ return;
+
if (!pulley || pulleyDir != 2) {
direction = dir;
}
@@ -32800,7 +_,17 @@
position.X = num;
direction = dir;
}
+ // added by TML, forward port from 1.4.5
+ else {
+ return;
+ }
}
+
+ // Added by TML, forward port from 1.4.5
+ compositeBackArm.rotation *= -1;
+ compositeFrontArm.rotation *= -1;
+ itemRotation *= -1;
+ itemLocation.X = MountedCenter.X + (MountedCenter.X - itemLocation.X);
}

public Rectangle getRect() => new Rectangle((int)position.X, (int)position.Y, width, height);
@@ -32875,8 +_,13 @@
public PlayerFishingConditions GetFishingConditions()
{
Expand Down

0 comments on commit 05f30a6

Please sign in to comment.