diff --git a/Plugins/Stats/Cheat/Detection.cs b/Plugins/Stats/Cheat/Detection.cs index db7fe4af2..b4e88db98 100644 --- a/Plugins/Stats/Cheat/Detection.cs +++ b/Plugins/Stats/Cheat/Detection.cs @@ -106,7 +106,12 @@ namespace IW4MAdmin.Plugins.Stats.Cheat lastHit = hit; } - if (lastHit == hit || lastHit.VictimId != hit.VictimId || (hit.TimeOffset - lastHit.TimeOffset) >= 1000) + bool areAnglesInvalid = hit.AnglesList[0].Equals(hit.AnglesList[1]) && hit.AnglesList[3].Equals(hit.AnglesList[4]); + + if ((lastHit == hit || + lastHit.VictimId != hit.VictimId || + (hit.TimeOffset - lastHit.TimeOffset) >= 1000) && + !areAnglesInvalid) { ClientStats.SnapHitCount++; sessionSnapHits++; @@ -147,7 +152,7 @@ namespace IW4MAdmin.Plugins.Stats.Cheat int angleOffsetIndex = totalUsableAngleCount / 2; if (hit.AnglesList.Count == 5) { - + double realAgainstPredict = Vector3.ViewAngleDistance(hit.AnglesList[angleOffsetIndex - 1], hit.AnglesList[angleOffsetIndex + 1], hit.ViewAngles); // LIFETIME diff --git a/SharedLibraryCore/Helpers/Vector3.cs b/SharedLibraryCore/Helpers/Vector3.cs index 08c7fb7f0..4bdf3c9d9 100644 --- a/SharedLibraryCore/Helpers/Vector3.cs +++ b/SharedLibraryCore/Helpers/Vector3.cs @@ -34,6 +34,16 @@ namespace SharedLibraryCore.Helpers return $"({X}, {Y}, {Z})"; } + public override bool Equals(object obj) + { + if (obj is Vector3 vec) + { + return vec.X == X && vec.Y == Y && vec.Z == Z; + } + + return false; + } + public static Vector3 Parse(string s) { bool valid = Regex.Match(s, @"\((-?[0-9]+\.?[0-9]*|-?[0-9]+\.?[0-9]*e-[0-9]+),\ (-?[0-9]+\.?[0-9]*|-?[0-9]+\.?[0-9]*e-[0-9]+),\ (-?[0-9]+\.?[0-9]*|-?[0-9]+\.?[0-9]*e-[0-9]+)\)").Success;