mirror of
https://github.com/D1GQ/BetterAmongUs.git
synced 2026-10-20 01:46:19 +00:00
Fix issues with custom rpcs
This commit is contained in:
1 parent
f03fef21aa
commit
fadcfce33c
2 files changed
+4
-4
No files matched your search
@@ -274,11 +274,11 @@ internal static class NetworkManager
|
||||
break;
|
||||
}
|
||||
|
||||
if (innerNetObject is PlayerControl player && player != null)
|
||||
if (innerNetObject is PlayerPhysics playerPhysics)
|
||||
{
|
||||
if (rpcCall == (byte)RPC.CUSTOM_RPC_CALL)
|
||||
{
|
||||
if (RPC.HandleCustomRPCPacked(player, reader))
|
||||
if (RPC.HandleCustomRPCPacked(playerPhysics.myPlayer, reader))
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -291,7 +291,7 @@ internal static class NetworkManager
|
||||
}
|
||||
else
|
||||
{
|
||||
if (innerNetObject is PlayerControl player2 && player2 != null)
|
||||
if (innerNetObject is PlayerControl player2)
|
||||
{
|
||||
RPC.HandleCustomRPCLegacy(player2, rpcCall, reader);
|
||||
}
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ internal static class RPC
|
||||
/// <param name="targetClientId">The specific client ID to target, or -1 to broadcast to all clients.</param>
|
||||
internal static void SendCustomRpcPacked(CustomRPC customRPC, Action<MessageWriter> action, int targetClientId = -1)
|
||||
{
|
||||
AmongUsClient.Instance.SendRpcImmediately(PlayerControl.LocalPlayer.NetId, CUSTOM_RPC_CALL, SendOption.Reliable, writer =>
|
||||
AmongUsClient.Instance.SendRpcImmediately(PlayerControl.LocalPlayer.MyPhysics.NetId, CUSTOM_RPC_CALL, SendOption.Reliable, writer =>
|
||||
{
|
||||
writer.Write(ModInfo.Constants.BAU_CUSTOM_RPC_FLAG); // Flag to check if its a rpc packed into SetNamePlateStr
|
||||
writer.Write((byte)customRPC);
|
||||
|
||||
Reference in new issue
Block a user