From bbb19a777cb6a667bf682fb07d48b611e176f06b Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Tue, 28 Dec 2010 20:07:26 +0100 Subject: [PATCH] anticheat: we now have good thresholds for div0_evade, as it seems --- qcsrc/server/anticheat.qc | 13 ++++++++++++- qcsrc/server/miscfunctions.qc | 9 ++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/qcsrc/server/anticheat.qc b/qcsrc/server/anticheat.qc index eae7df6aa..284e72be9 100644 --- a/qcsrc/server/anticheat.qc +++ b/qcsrc/server/anticheat.qc @@ -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() diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 02fa0f806..a770ec55e 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -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) { -- 2.39.2