X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fanticheat.qc;h=1e6759684a593df5fea8690173ee76946d2b4fbe;hb=f604d84f61f6db78cf9cb7c3cc6b9cfe7f14278f;hp=377e0b587c1c9dc7a9ed0cf8e3a054079812c98d;hpb=35e8f712933b0ebf9b163b7289cf975825b33803;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/anticheat.qc b/qcsrc/server/anticheat.qc index 377e0b587..1e6759684 100644 --- a/qcsrc/server/anticheat.qc +++ b/qcsrc/server/anticheat.qc @@ -1,37 +1,38 @@ -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../dpdefs/progsdefs.qh" - #include "../dpdefs/dpextensions.qh" - #include "sys-post.qh" - #include "../warpzonelib/mathlib.qh" - #include "autocvars.qh" - #include "defs.qh" - #include "command/common.qh" - #include "anticheat.qh" -#endif +#include "anticheat.qh" + +#include "antilag.qh" +#include "autocvars.qh" +#include "defs.qh" +#include "miscfunctions.qh" + +#include "../dpdefs/progsdefs.qh" +#include "../dpdefs/dpextensions.qh" + +#include "../warpzonelib/mathlib.qh" + +#include "command/common.qh" .float anticheat_jointime; void mean_accumulate(entity e, .float a, .float c, float mean, float value, float weight) { - if(weight == 0) + if (weight == 0) return; - if(mean == 0) - e.a *= pow(value, weight); + if (mean == 0) + e.(a) *= pow(value, weight); else - e.a += pow(value, mean) * weight; - e.c += weight; + e.(a) += pow(value, mean) * weight; + e.(c) += weight; } float mean_evaluate(entity e, .float a, .float c, float mean) { - if(e.c == 0) + if (e.(c) == 0) return 0; - if(mean == 0) - return pow(e.a, 1.0 / e.c); + if (mean == 0) + return pow(e.(a), 1.0 / e.(c)); else - return pow(e.a / e.c, 1.0 / mean); + return pow(e.(a) / e.(c), 1.0 / mean); } #define MEAN_ACCUMULATE(prefix,v,w) mean_accumulate(self,prefix##_accumulator,prefix##_count,prefix##_mean,v,w)