Skip to content

Commit

Permalink
Change: TeleportPlayer improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
scp222thj committed Jan 7, 2024
1 parent 74e4201 commit d1878fb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Other/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,9 @@ public static void TeleportPlayer(PlayerControl player, Vector2 position)
if (HostData != null && !HostData.Character.Data.Disconnected)
{
foreach (PlayerControl item in PlayerControl.AllPlayerControls){
ushort num = (ushort)(player.NetTransform.lastSequenceId + 2);
MessageWriter messageWriter = AmongUsClient.Instance.StartRpcImmediately(player.NetTransform.NetId, (byte)RpcCalls.SnapTo, SendOption.None, AmongUsClient.Instance.GetClientIdFromCharacter(item));
NetHelpers.WriteVector2(position, messageWriter);
messageWriter.Write(num);
messageWriter.Write(player.NetTransform.lastSequenceId + 100U);
AmongUsClient.Instance.FinishRpcImmediately(messageWriter);
}
}
Expand Down

0 comments on commit d1878fb

Please sign in to comment.