mirror of
https://github.com/D1GQ/BetterAmongUs.git
synced 2026-10-20 01:46:19 +00:00
fix
This commit is contained in:
1 parent
459207c577
commit
3943af229d
2 files changed
+23
-4
No files matched your search
+11
-2
@@ -234,14 +234,23 @@ class AntiCheat
|
||||
|
||||
if (callId is (byte)RpcCalls.MurderPlayer)
|
||||
{
|
||||
bool condition = false;
|
||||
|
||||
if (ExtendedPlayerInfo.TimeSinceKill.TryGetValue(player, out var value))
|
||||
{
|
||||
if (value < GameOptionsManager.Instance.currentNormalGameOptions.KillCooldown)
|
||||
{
|
||||
condition = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (reader.BytesRemaining > 0)
|
||||
{
|
||||
PlayerControl target = reader.ReadNetObject<PlayerControl>();
|
||||
|
||||
if (target != null)
|
||||
{
|
||||
if (!player.IsImpostorTeam() || !player.IsAlive() || player.IsInVanish() || !target.IsAlive() || target.IsImpostorTeam()
|
||||
|| ExtendedPlayerInfo.TimeSinceKill.TryGetValue(player, out var value) && value < (float)GameOptionsManager.Instance.currentNormalGameOptions.KillCooldown)
|
||||
if (!player.IsImpostorTeam() || !player.IsAlive() || player.IsInVanish() || !target.IsAlive() || target.IsImpostorTeam() || condition)
|
||||
{
|
||||
BetterNotificationManager.NotifyCheat(player, $"Invalid Action RPC: {Enum.GetName((RpcCalls)callId)}");
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ class BetterHostManager
|
||||
|
||||
public static bool CheckRPCAsHost(PlayerControl player, byte callId, MessageReader reader, ref bool canceled)
|
||||
{
|
||||
if (player == null) return true;
|
||||
if (player == null || !GameStates.IsHost) return true;
|
||||
|
||||
bool shouldReturn = false;
|
||||
|
||||
@@ -97,6 +97,16 @@ class BetterHostManager
|
||||
{
|
||||
PlayerControl target = reader.ReadNetObject<PlayerControl>();
|
||||
|
||||
bool condition = false;
|
||||
|
||||
if (ExtendedPlayerInfo.TimeSinceKill.TryGetValue(player, out var value))
|
||||
{
|
||||
if (value >= GameOptionsManager.Instance.currentNormalGameOptions.KillCooldown)
|
||||
{
|
||||
condition = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (target != null)
|
||||
{
|
||||
if (player.IsAlive()
|
||||
@@ -107,7 +117,7 @@ class BetterHostManager
|
||||
&& !player.shapeshifting
|
||||
&& !player.onLadder
|
||||
&& !player.MyPhysics.Animations.IsPlayingAnyLadderAnimation()
|
||||
&& ExtendedPlayerInfo.TimeSinceKill.TryGetValue(player, out var value) && value >= (float)GameOptionsManager.Instance.currentNormalGameOptions.KillCooldown
|
||||
&& condition
|
||||
&& CheckRange(player.GetCustomPosition(), target.GetCustomPosition(), 3f))
|
||||
{
|
||||
if (target.IsAlive()
|
||||
|
||||
Reference in new issue
Block a user