]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
anticheat: we now have good thresholds for div0_evade, as it seems
authorRudolf Polzer <divverent@alientrap.org>
Tue, 28 Dec 2010 19:07:26 +0000 (20:07 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Tue, 28 Dec 2010 19:07:26 +0000 (20:07 +0100)
qcsrc/server/anticheat.qc
qcsrc/server/miscfunctions.qc

index eae7df6aaa81ccb1576155d36281bf6999243697..284e72be94602cbb1f5ea85585f015d24b6e6040 100644 (file)
@@ -153,6 +153,17 @@ void anticheat_prethink()
        self.anticheat_div0_evade_offset = 0;
 }
 
+string anticheat_display(float f, float mi, float ma)
+{
+       string s;
+       s = ftos(f);
+       if(f <= mi)
+               return strcat(s, ":N");
+       if(f >= ma)
+               return strcat(s, ":Y");
+       return strcat(s, ":-");
+}
+
 void anticheat_report()
 {
        if(!autocvar_sv_eventlog)
@@ -161,7 +172,7 @@ void anticheat_report()
        GameLogEcho(strcat(":anticheat:speedhack:", ftos(self.playerid), ":", ftos(MEAN_EVALUATE(anticheat_speedhack))));
        GameLogEcho(strcat(":anticheat:div0_strafebot_old:", ftos(self.playerid), ":", ftos(MEAN_EVALUATE(anticheat_div0_strafebot_old))));
        GameLogEcho(strcat(":anticheat:div0_strafebot_new:", ftos(self.playerid), ":", ftos(MEAN_EVALUATE(anticheat_div0_strafebot_new))));
-       GameLogEcho(strcat(":anticheat:div0_evade:", ftos(self.playerid), ":", ftos(MEAN_EVALUATE(anticheat_div0_evade))));
+       GameLogEcho(strcat(":anticheat:div0_evade:", ftos(self.playerid), ":", anticheat_display(MEAN_EVALUATE(anticheat_div0_evade), 0.15, 0.3)));
 }
 
 void anticheat_serverframe()
index 02fa0f806fdd7b880351e5c323c1dc34f1ea197a..a770ec55eb5c0bbd1be910cddf08844b3203e179 100644 (file)
@@ -997,9 +997,7 @@ void readplayerstartcvars()
                start_armorvalue = 0;
                start_weapons = WEPBIT_MINSTANEX;
                weapon_action(WEP_MINSTANEX, WR_PRECACHE);
-               start_ammo_cells = cvar("g_minstagib_ammo_start");
                g_minstagib_invis_alpha = cvar("g_minstagib_invis_alpha");
-               start_ammo_fuel = cvar("g_start_ammo_fuel");
 
                if (g_minstagib_invis_alpha <= 0)
                        g_minstagib_invis_alpha = -1;
@@ -1017,7 +1015,12 @@ void readplayerstartcvars()
        if(!cvar("g_use_ammunition"))
                start_items |= IT_UNLIMITED_AMMO;
 
-       if(start_items & IT_UNLIMITED_WEAPON_AMMO)
+       if(g_minstagib)
+       {
+               start_ammo_cells = cvar("g_minstagib_ammo_start");
+               start_ammo_fuel = cvar("g_start_ammo_fuel");
+       }
+       else if(start_items & IT_UNLIMITED_WEAPON_AMMO)
        {
                for (j = WEP_FIRST; j <= WEP_LAST; ++j)
                {