]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/anticheat.qc
Merge branch 'master' into Mirio/balance
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / anticheat.qc
index 739695e77ea5aa9ff13d7a3887a37fa00762d9a2..865010ff5c5a6d8afdfbd0f2280c4dbb1f46edef 100644 (file)
@@ -85,7 +85,7 @@ void anticheat_physics(entity this)
        this.anticheat_div0_strafebot_movement_prev = this.movement;
 
        // Note: this actually tries to detect snap-aim.
-       if(vlen(this.anticheat_div0_strafebot_forward_prev) && time > this.anticheat_fixangle_endtime) {
+       if(this.anticheat_div0_strafebot_forward_prev && time > this.anticheat_fixangle_endtime) {
                float cosangle = this.anticheat_div0_strafebot_forward_prev * v_forward;
                float angle = cosangle < -1 ? M_PI : cosangle > 1 ? 0 : acos(cosangle);
                /*
@@ -232,18 +232,17 @@ void anticheat_fixangle()
 
 void anticheat_endframe()
 {SELFPARAM();
-       entity e;
-       FOR_EACH_CLIENT(e)
-               if (e.fixangle) {
-                       WITH(entity, self, e, anticheat_fixangle());
-               }
+       FOREACH_CLIENT(true, LAMBDA(
+               if(it.fixangle)
+                       WITH(entity, self, it, anticheat_fixangle());
+       ));
        anticheat_div0_evade_evasion_delta += frametime * (0.5 + random());
 }
 
-void anticheat_init()
-{SELFPARAM();
-       self.anticheat_speedhack_offset = 0;
-       self.anticheat_jointime = servertime;
+void anticheat_init(entity this)
+{
+       this.anticheat_speedhack_offset = 0;
+       this.anticheat_jointime = servertime;
 }
 
 void anticheat_shutdown()