mirror of
https://github.com/D1GQ/BetterAmongUs.git
synced 2026-10-19 15:51:52 +00:00
Fix logical error possibly desyncing Viper
This commit is contained in:
1 parent
688e2f2854
commit
51959c2bec
2 files changed
+3
-3
No files matched your search
@@ -99,7 +99,7 @@ static class PlayerControlHelper
|
||||
{
|
||||
var Ban = ban || forceBan;
|
||||
|
||||
if (!GameState.IsHost || player.IsLocalPlayer() || !player.DataIsCollected() && !bypassDataCheck || player.IsHost() || player.isDummy)
|
||||
if (!GameState.IsHost || player.IsLocalPlayer() || (!player.DataIsCollected() && !bypassDataCheck) || player.IsHost() || player.isDummy)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -311,7 +311,7 @@ static class PlayerControlHelper
|
||||
/// </summary>
|
||||
/// <param name="data">The player data to check.</param>
|
||||
/// <returns>True if the player is on the impostor team.</returns>
|
||||
internal static bool IsImpostorTeam(this NetworkedPlayerInfo data) => data?.RoleType is RoleTypes.Impostor or RoleTypes.ImpostorGhost or RoleTypes.Shapeshifter or RoleTypes.Phantom or RoleTypes.Viper;
|
||||
internal static bool IsImpostorTeam(this NetworkedPlayerInfo data) => data?.RoleType.GetBehaviourPrefab().IsImpostor == true;
|
||||
|
||||
/// <summary>
|
||||
/// Checks if a player is an impostor teammate of the local player.
|
||||
|
||||
@@ -154,7 +154,7 @@ internal static class RoleManagerPatch
|
||||
// Desync role to hide special role from non-BAU players
|
||||
if (BetterGameSettings.DesyncRoles.GetBool())
|
||||
{
|
||||
if (kvp.Key is not RoleTypes.Phantom or RoleTypes.Viper)
|
||||
if (kvp.Key is not (RoleTypes.Phantom or RoleTypes.Viper))
|
||||
{
|
||||
List<MessageWriter> messageWriter = AmongUsClient.Instance.StartRpcDesync(pc.NetId, (byte)RpcCalls.SetRole, SendOption.None, pc.GetClientId(), clientCheck);
|
||||
messageWriter.ForEach(mW => mW.Write((ushort)RoleTypes.Impostor));
|
||||
|
||||
Reference in new issue
Block a user