Skip to content

Commit

Permalink
fix: Fixes boat movement bugs & distorted entity placement. (#1457)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamronbatman authored Aug 16, 2023
1 parent 431e7fb commit 6e23afe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions Projects/UOContent/Multis/Boats/BaseBoat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1395,6 +1395,7 @@ private bool SafelyStartMoveTimer(TimeSpan interval, bool single)
_moveTimer.Stop();
_moveTimer.Delay = delay;
_moveTimer.Interval = interval;
_moveTimer.Single = singleNum;
}
else
{
Expand Down Expand Up @@ -1807,8 +1808,10 @@ public bool Move(Direction dir, int speed, int clientSpeed, bool message)
{
item.NoMoveHS = true;

// Already filtered for Tiller/Hold/Plank/EffectItem
item.Location = new Point3D(item.X + xOffset, item.Y + yOffset, item.Z);
if (item is not (Server.Items.TillerMan or Server.Items.Hold or Plank))
{
item.Location = new Point3D(item.X + xOffset, item.Y + yOffset, item.Z);
}
}
else if (e is Mobile m)
{
Expand Down
2 changes: 1 addition & 1 deletion Projects/UOContent/Multis/Boats/BoatPackets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static void SendMoveBoatHS(this NetState ns, Mobile beholder, BaseBoat bo
return;
}

var minLength = 68; // 18 + 5 * 10
const int minLength = 68; // 18 + 5 * 10
var writer = new SpanWriter(stackalloc byte[minLength], true);
writer.Write((byte)0xF6); // Packet ID
writer.Seek(2, SeekOrigin.Current);
Expand Down

0 comments on commit 6e23afe

Please sign in to comment.