prevent "laggy" angles from being tracked
This commit is contained in:
parent
483b7917ac
commit
082776aca5
@ -106,7 +106,12 @@ namespace IW4MAdmin.Plugins.Stats.Cheat
|
|||||||
lastHit = hit;
|
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++;
|
ClientStats.SnapHitCount++;
|
||||||
sessionSnapHits++;
|
sessionSnapHits++;
|
||||||
|
@ -34,6 +34,16 @@ namespace SharedLibraryCore.Helpers
|
|||||||
return $"({X}, {Y}, {Z})";
|
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)
|
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;
|
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;
|
||||||
|
Loading…
Reference in New Issue
Block a user