]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/anticheat.qc
Merge branch 'master' into TimePath/notifications
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / anticheat.qc
index 79442299e197343ccd6b4c32aa769c0f7bf5e173..982a426068517c811b6b91ad03bb3be4b3e3d3db 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);
                /*
@@ -239,12 +239,8 @@ void anticheat_endframe()
        anticheat_div0_evade_evasion_delta += frametime * (0.5 + random());
 }
 
-void anticheat_init()
-{SELFPARAM();
-       self.anticheat_speedhack_offset = 0;
-       self.anticheat_jointime = servertime;
-}
-
-void anticheat_shutdown()
+void anticheat_init(entity this)
 {
+       this.anticheat_speedhack_offset = 0;
+       this.anticheat_jointime = servertime;
 }