_cl_playerskin 0
seta cl_reticle 1 "control for toggling whether ANY zoom reticles are shown"
-seta cl_reticle_stretch 0 "whether to stretch reticles so they fit the screen (brakes image proportions)"
+seta cl_reticle_stretch 0 "whether to stretch reticles so they fit the screen (breaks image proportions)"
seta cl_reticle_item_nex 1 "draw aiming reticle for the nex weapon's zoom, 0 disables and values between 0 and 1 change alpha"
seta cl_reticle_item_normal 1 "draw reticle when zooming with the zoom button, 0 disables and values between 0 and 1 change alpha"
fov 100
set cl_hitsound_antispam_time 0.05 "don't play the hitsound more often than this"
seta cl_eventchase_death 1 "camera goes into 3rd person mode when the player is dead"
+seta cl_eventchase_nexball 1 "camera goes into 3rd person mode when in nexball game-mode"
seta cl_eventchase_distance 140 "final camera distance"
seta cl_eventchase_speed 1.3 "how fast the camera slides back, 0 is instant"
seta cl_eventchase_maxs "12 12 8" "max size of eventchase camera bbox"
sex Male
weight 105
age 26
+bone_upperbody Bip001 Neck
+bone_aim0 0.25 Bip001 Neck
+bone_aim1 0.4 Bip001 Neck
+bone_aim2 0.2 Bip001 L UpperArm
+bone_aim3 0.35 bip01 r hand
+bone_weapon bip01 r hand
+fixbone 1
overkill solider
sex Male
weight 105
age 26
+bone_upperbody Bip001 Neck
+bone_aim0 0.25 Bip001 Neck
+bone_aim1 0.4 Bip001 Neck
+bone_aim2 0.2 Bip001 L UpperArm
+bone_aim3 0.35 bip01 r hand
+bone_weapon bip01 r hand
+fixbone 1
overkill officer
\ No newline at end of file
sex Male
weight 105
age 28
+bone_upperbody Bip001 Neck
+bone_aim0 0.25 Bip001 Neck
+bone_aim1 0.4 Bip001 Neck
+bone_aim2 0.2 Bip001 L UpperArm
+bone_aim3 0.35 bip01 r hand
+bone_weapon bip01 r hand
+fixbone 1
overkill solider
sex Male
weight 105
age 28
+bone_upperbody Bip001 Neck
+bone_aim0 0.25 Bip001 Neck
+bone_aim1 0.4 Bip001 Neck
+bone_aim2 0.2 Bip001 L UpperArm
+bone_aim3 0.35 bip01 r hand
+bone_weapon bip01 r hand
+fixbone 1
overkill solider
sex None
weight 200
age 1
+bone_upperbody Bip001 Neck
+bone_aim0 0.25 Bip001 Neck
+bone_aim1 0.4 Bip001 Neck
+bone_aim2 0.2 Bip001 L UpperArm
+bone_aim3 0.35 bip01 r hand
+bone_weapon bip01 r hand
+fixbone 1
Overkill robot
sex None
weight 200
age 1
+bone_upperbody Bip001 Neck
+bone_aim0 0.25 Bip001 Neck
+bone_aim1 0.4 Bip001 Neck
+bone_aim2 0.2 Bip001 L UpperArm
+bone_aim3 0.35 bip01 r hand
+bone_weapon bip01 r hand
+fixbone 1
Overkill robot
sex None
weight 200
age 1
+bone_upperbody Bip001 Neck
+bone_aim0 0.25 Bip001 Neck
+bone_aim1 0.4 Bip001 Neck
+bone_aim2 0.2 Bip001 L UpperArm
+bone_aim3 0.35 bip01 r hand
+bone_weapon bip01 r hand
+fixbone 1
Overkill robot
sex None
weight 200
age 1
+bone_upperbody Bip001 Neck
+bone_aim0 0.25 Bip001 Neck
+bone_aim1 0.4 Bip001 Neck
+bone_aim2 0.2 Bip001 L UpperArm
+bone_aim3 0.35 bip01 r hand
+bone_weapon bip01 r hand
+fixbone 1
Overkill robot
XON_BUILDSYSTEM =
all: qc
+.PHONY: all
.PHONY: qc
-qc:
- $(MAKE) qc-recursive
-
-.PHONY: qc-recursive
-qc-recursive: ../menu.dat ../progs.dat ../csprogs.dat
+qc: ../menu.dat ../progs.dat ../csprogs.dat
.PHONY: clean
clean:
default:
if(GetTeam(Team, false) == world)
{
- printf(_("trying to switch to unsupported team %d\n"), Team);
+ dprintf("trying to switch to unsupported team %d\n", Team);
Team = NUM_SPECTATOR;
}
break;
default:
if(GetTeam(Team, false) == world)
{
- printf(_("trying to switch to unsupported team %d\n"), Team);
+ dprintf("trying to switch to unsupported team %d\n", Team);
Team = NUM_SPECTATOR;
}
break;
// event chase camera
if(autocvar_chase_active <= 0) // greater than 0 means it's enabled manually, and this code is skipped
{
- if(((spectatee_status >= 0 && (autocvar_cl_eventchase_death && is_dead)) || intermission) && !autocvar_cl_orthoview)
+ WepSet weapons_stat = WepSet_GetFromStat();
+ if(((spectatee_status >= 0 && (autocvar_cl_eventchase_death && is_dead)) || intermission) && !autocvar_cl_orthoview || (autocvar_cl_eventchase_nexball && gametype == MAPINFO_TYPE_NEXBALL && !(weapons_stat & WepSet_FromWeapon(WEP_PORTO))))
{
// make special vector since we can't use view_origin (It is one frame old as of this code, it gets set later with the results this code makes.)
vector current_view_origin = (csqcplayer ? csqcplayer.origin : pmove_org);
float autocvar_cl_hitsound;
float autocvar_cl_hitsound_antispam_time;
var float autocvar_cl_eventchase_death = 1;
+var float autocvar_cl_eventchase_nexball = 1;
var float autocvar_cl_eventchase_distance = 140;
var float autocvar_cl_eventchase_speed = 1.3;
var vector autocvar_cl_eventchase_maxs = '12 12 8';
break;
}
- if((self.owner.sv_entnum == player_localentnum - 1))
+ if((self.owner.sv_entnum == player_localentnum - 1) && autocvar_chase_active <= 0)
{
switch(self.HookType)
{
case ENT_CLIENT_HOOK:
intensity = 1;
offset = 0;
- if(t == NUM_TEAM_1)
+ switch(t)
{
- tex = "particles/hook_red";
- rgb = '1 .3 .3';
- }
- else if(t == NUM_TEAM_2)
- {
- tex = "particles/hook_blue";
- rgb = '.3 .3 1';
- }
- else if(t == NUM_TEAM_3)
- {
- tex = "particles/hook_yellow";
- rgb = '1 1 .3';
- }
- else if(t == NUM_TEAM_4)
- {
- tex = "particles/hook_pink";
- rgb = '1 .3 1';
- }
- else
- {
- tex = "particles/hook_green";
- rgb = '.3 1 .3';
+ case NUM_TEAM_1: tex = "particles/hook_red"; rgb = '1 0.3 0.3'; break;
+ case NUM_TEAM_2: tex = "particles/hook_blue"; rgb = '0.3 0.3 1'; break;
+ case NUM_TEAM_3: tex = "particles/hook_yellow"; rgb = '1 1 0.3'; break;
+ case NUM_TEAM_4: tex = "particles/hook_pink"; rgb = '1 0.3 1'; break;
+ default: tex = "particles/hook_white"; rgb = getcsqcplayercolor(self.sv_entnum); break;
}
break;
case ENT_CLIENT_LGBEAM:
if(sf & 1)
{
- self.owner = playerslots[ReadByte() - 1];
+ float myowner = ReadByte();
+ self.owner = playerslots[myowner - 1];
+ self.sv_entnum = myowner;
switch(self.HookType)
{
default:
#define HUD_PANEL(NAME,draw_func,name) \
float HUD_PANEL_##NAME; \
- void ##draw_func(void); \
+ void draw_func(void); \
void RegisterHUD_Panel_##NAME() \
{ \
HUD_PANEL_LAST = HUD_PANEL_##NAME = HUD_PANEL_NUM; \
hud_panelent.classname = "hud_panel"; \
hud_panelent.panel_name = #name; \
hud_panelent.panel_id = HUD_PANEL_##NAME; \
- hud_panelent.panel_draw = ##draw_func; \
+ hud_panelent.panel_draw = draw_func; \
++HUD_PANEL_NUM; \
} \
ACCUMULATE_FUNCTION(RegisterHUD_Panels, RegisterHUD_Panel_##NAME);
return 1;
}
+vector getcsqcplayercolor(float pl)
+{
+ entity e;
+
+ e = CSQCModel_server2csqc(pl);
+ if(e)
+ {
+ if(e.colormap > 0)
+ return colormapPaletteColor(((e.colormap >= 1024) ? e.colormap : stof(getplayerkeyvalue(e.colormap - 1, "colors"))) & 0x0F, TRUE);
+ }
+
+ return '1 1 1';
+}
+
float getplayerisdead(float pl)
{
entity e;
}
pos = HUD_DrawScoreboardRankings(pos, playerslots[player_localnum], rgb, bg_size);
}
- else if(autocvar_scoreboard_accuracy && spectatee_status != -1 && !warmup_stage) {
+ else if(autocvar_scoreboard_accuracy && spectatee_status == 0 && !warmup_stage && gametype != MAPINFO_TYPE_NEXBALL) {
if(teamplay)
pos = HUD_DrawScoreboardAccuracyStats(pos, Team_ColorRGB(myteam), bg_size);
else
// Print info string
float tl, fl, ll;
- str = sprintf(_("playing on ^2%s^7"), shortmapname);
+ str = sprintf(_("playing ^3%s^7 on ^2%s^7"), MapInfo_Type_ToText(gametype), shortmapname);
tl = getstatf(STAT_TIMELIMIT);
fl = getstatf(STAT_FRAGLIMIT);
ll = getstatf(STAT_LEADLIMIT);
// print information about respawn status
float respawn_time = getstatf(STAT_RESPAWN_TIME);
+ if(!intermission)
if(respawn_time)
{
if(respawn_time < 0)
case "race-finish": return _("Finish");
case "race-start": return _("Start");
case "race-start-finish": return (race_checkpointtime || race_mycheckpointtime) ? _("Finish") : _("Start");
+ case "goal": return _("Goal");
case "nb-ball": return _("Ball");
case "ka-ball": return _("Ball");
case "ka-ballcarrier": return _("Ball carrier");
MSG_CENTER_NOTIF(1, CENTER_JOIN_PREVENT, 0, 0, "", CPID_PREVENT_JOIN, "0 0", _("^K1You may not join the game at this time.\nThe player limit reached maximum capacity."), "") \
MSG_CENTER_NOTIF(1, CENTER_KEEPAWAY_DROPPED, 1, 0, "s1", CPID_KEEPAWAY, "0 0", _("^BG%s^BG has dropped the ball!"), "") \
MSG_CENTER_NOTIF(1, CENTER_KEEPAWAY_PICKUP, 1, 0, "s1", CPID_KEEPAWAY, "0 0", _("^BG%s^BG has picked up the ball!"), "") \
+ MSG_CENTER_NOTIF(1, CENTER_KEEPAWAY_PICKUP_SELF, 0, 0, "", CPID_KEEPAWAY, "0 0", _("^BGYou picked up the ball"), "") \
MSG_CENTER_NOTIF(1, CENTER_KEEPAWAY_WARN, 0, 0, "", CPID_KEEPAWAY_WARN, "0 0", _("^BGKilling people while you don't have the ball gives no points!"), "") \
MSG_CENTER_NOTIF(1, CENTER_KEYHUNT_HELP, 0, 0, "", CPID_KEYHUNT, "0 0", _("^BGAll keys are in your team's hands!\nHelp the key carriers to meet!"), "") \
MULTITEAM_CENTER(1, CENTER_KEYHUNT_INTERFERE_, 4, 0, 0, "", CPID_KEYHUNT, "0 0", _("^BGAll keys are in ^TC^TT team^BG's hands!\nInterfere ^F4NOW^BG!"), "") \
if(key == K_ESCAPE)
return;
+ // forbid these keys from being bound in the menu
+ if(key == K_CAPSLOCK || key == K_NUMLOCK)
+ {
+ KeyBinder_Bind_Change(me, me);
+ return;
+ }
+
func = Xonotic_KeyBinds_Functions[me.selectedItem];
if(func == "")
return;
GAMETYPE(MAPINFO_TYPE_LMS) \
GAMETYPE(MAPINFO_TYPE_NEXBALL) \
GAMETYPE(MAPINFO_TYPE_ONSLAUGHT) \
- GAMETYPE(MAPINFO_TYPE_RACE) \
+ if (cvar("developer")) GAMETYPE(MAPINFO_TYPE_RACE) \
GAMETYPE(MAPINFO_TYPE_CTS) \
GAMETYPE(MAPINFO_TYPE_TEAM_DEATHMATCH) \
//GAMETYPE(MAPINFO_TYPE_INVASION) \
float i;
i = 0;
- #define GAMETYPE(id) if(i++ == cnt) return id;
+ #define GAMETYPE(id) { if(i++ == cnt) return id; }
GAMETYPES
#undef GAMETYPE
#define MEAN_EVALUATE(prefix) mean_evaluate(self,prefix##_accumulator,prefix##_count,prefix##_mean)
#define MEAN_DECLARE(prefix,m) float prefix##_mean = m; .float prefix##_count, prefix##_accumulator
+.float anticheat_fixangle_endtime;
+
float anticheat_div0_evade_evasion_delta;
.float anticheat_div0_evade_offset;
.vector anticheat_div0_evade_v_angle;
.vector anticheat_div0_strafebot_forward_prev;
MEAN_DECLARE(anticheat_div0_strafebot_new, 5);
+// Snap-aim detection: we track the average angular speed of aiming over time, in "radians per second".
+// Signal: a high-power mean. Cheaters will have high "signal" here.
+// Noise: a low-power mean. Active/shivery players will have high "noise" here.
+// Note one can always artificially add noise - so very high values of both signal and noise need to be checked too.
+MEAN_DECLARE(anticheat_idle_snapaim_signal, 5);
+MEAN_DECLARE(anticheat_idle_snapaim_noise, 1);
+
+// TEMP DEBUG STUFF.
+MEAN_DECLARE(anticheat_idle_snapaim_m2, 2);
+MEAN_DECLARE(anticheat_idle_snapaim_m3, 3);
+MEAN_DECLARE(anticheat_idle_snapaim_m4, 4);
+MEAN_DECLARE(anticheat_idle_snapaim_m7, 7);
+MEAN_DECLARE(anticheat_idle_snapaim_m10, 10);
+
.float anticheat_speedhack_offset;
.float anticheat_speedhack_movetime, anticheat_speedhack_movetime_count, anticheat_speedhack_movetime_frac;
MEAN_DECLARE(anticheat_speedhack, 5);
+.float anticheat_speedhack_accu;
+.float anticheat_speedhack_lasttime;
+MEAN_DECLARE(anticheat_speedhack_m1, 1);
+MEAN_DECLARE(anticheat_speedhack_m2, 2);
+MEAN_DECLARE(anticheat_speedhack_m3, 3);
+MEAN_DECLARE(anticheat_speedhack_m4, 4);
+MEAN_DECLARE(anticheat_speedhack_m5, 5);
+
float movement_oddity(vector m0, vector m1)
{
float cosangle = normalize(m0) * normalize(m1);
if(self.anticheat_div0_evade_offset == 0)
{
f = fabs(anticheat_div0_evade_evasion_delta - floor(anticheat_div0_evade_evasion_delta) - 0.5) * 2; // triangle function
- self.anticheat_div0_evade_offset = time + sys_frametime * (3 * f - 1);
+ self.anticheat_div0_evade_offset = servertime + sys_frametime * (3 * f - 1);
self.anticheat_div0_evade_v_angle = self.v_angle;
self.anticheat_div0_evade_forward_initial = v_forward;
MEAN_ACCUMULATE(anticheat_div0_evade, 0, 1);
MEAN_ACCUMULATE(anticheat_div0_strafebot_old, movement_oddity(self.movement, self.anticheat_div0_strafebot_movement_prev), 1);
self.anticheat_div0_strafebot_movement_prev = self.movement;
- if(vlen(self.anticheat_div0_strafebot_forward_prev))
- MEAN_ACCUMULATE(anticheat_div0_strafebot_new, 0.5 - 0.5 * (self.anticheat_div0_strafebot_forward_prev * v_forward), 1);
+ // Note: this actually tries to detect snap-aim.
+ if(vlen(self.anticheat_div0_strafebot_forward_prev) && time > self.anticheat_fixangle_endtime) {
+ float cosangle = self.anticheat_div0_strafebot_forward_prev * v_forward;
+ float angle = cosangle < -1 ? M_PI : cosangle > 1 ? 0 : acos(cosangle);
+ /*
+ if (angle >= 10 * M_PI / 180)
+ printf("SNAP %s: %f for %f, %f since fixangle\n", self.netname, angle * 180 / M_PI, cosangle, time - self.anticheat_fixangle_endtime);
+ */
+ MEAN_ACCUMULATE(anticheat_div0_strafebot_new, angle / M_PI, 1);
+
+ if (autocvar_slowmo > 0) {
+ // Technically this is a NOP, as the engine should be ensuring
+ // this in the first place. Let's guard against dividing by
+ // zero anyway.
+ float dt = max(0.001, frametime) / autocvar_slowmo;
+
+ float anglespeed = angle / dt;
+ MEAN_ACCUMULATE(anticheat_idle_snapaim_signal, anglespeed, dt);
+ MEAN_ACCUMULATE(anticheat_idle_snapaim_noise, anglespeed, dt);
+ MEAN_ACCUMULATE(anticheat_idle_snapaim_m2, anglespeed, dt);
+ MEAN_ACCUMULATE(anticheat_idle_snapaim_m3, anglespeed, dt);
+ MEAN_ACCUMULATE(anticheat_idle_snapaim_m4, anglespeed, dt);
+ MEAN_ACCUMULATE(anticheat_idle_snapaim_m7, anglespeed, dt);
+ MEAN_ACCUMULATE(anticheat_idle_snapaim_m10, anglespeed, dt);
+ }
+ }
self.anticheat_div0_strafebot_forward_prev = v_forward;
// generic speedhack detection: correlate anticheat_speedhack_movetime (UPDATED BEFORE THIS) and server time
self.anticheat_speedhack_offset += (f - self.anticheat_speedhack_offset) * frametime * 0.1;
}
+ // new generic speedhack detection
+ if (self.anticheat_speedhack_lasttime > 0) {
+ float dt = servertime - self.anticheat_speedhack_lasttime;
+ const float falloff = 0.2;
+ self.anticheat_speedhack_accu *= exp(-dt * falloff);
+ self.anticheat_speedhack_accu += frametime * falloff;
+ // NOTE: at cl_netfps x, this actually averages not to 1, but to 1/x * falloff / (1 - exp(-1/x * falloff))
+ // For 15 netfps (absolute minimum bearable), and 0.2 falloff, this is: 1.0067
+ self.anticheat_speedhack_lasttime = servertime;
+ MEAN_ACCUMULATE(anticheat_speedhack_m1, self.anticheat_speedhack_accu, frametime);
+ MEAN_ACCUMULATE(anticheat_speedhack_m2, self.anticheat_speedhack_accu, frametime);
+ MEAN_ACCUMULATE(anticheat_speedhack_m3, self.anticheat_speedhack_accu, frametime);
+ MEAN_ACCUMULATE(anticheat_speedhack_m4, self.anticheat_speedhack_accu, frametime);
+ MEAN_ACCUMULATE(anticheat_speedhack_m5, self.anticheat_speedhack_accu, frametime);
+ } else {
+ self.anticheat_speedhack_accu = 1;
+ self.anticheat_speedhack_lasttime = servertime;
+ }
+
// race/CTS: force kbd movement for fairness
if(g_race || g_cts)
{
{
if(!autocvar_sv_eventlog)
return;
+ // TODO(divVerent): Use xonstat to acquire good thresholds.
GameLogEcho(strcat(":anticheat:_time:", ftos(self.playerid), ":", ftos(servertime - self.anticheat_jointime)));
GameLogEcho(strcat(":anticheat:speedhack:", ftos(self.playerid), ":", anticheat_display(MEAN_EVALUATE(anticheat_speedhack), 240, 0.1, 0.15)));
+ GameLogEcho(strcat(":anticheat:speedhack_m1:", ftos(self.playerid), ":", anticheat_display(MEAN_EVALUATE(anticheat_speedhack_m1), 240, 0.1, 0.15)));
+ GameLogEcho(strcat(":anticheat:speedhack_m2:", ftos(self.playerid), ":", anticheat_display(MEAN_EVALUATE(anticheat_speedhack_m2), 240, 0.1, 0.15)));
+ GameLogEcho(strcat(":anticheat:speedhack_m3:", ftos(self.playerid), ":", anticheat_display(MEAN_EVALUATE(anticheat_speedhack_m3), 240, 0.1, 0.15)));
+ GameLogEcho(strcat(":anticheat:speedhack_m4:", ftos(self.playerid), ":", anticheat_display(MEAN_EVALUATE(anticheat_speedhack_m4), 240, 0.1, 0.15)));
+ GameLogEcho(strcat(":anticheat:speedhack_m5:", ftos(self.playerid), ":", anticheat_display(MEAN_EVALUATE(anticheat_speedhack_m5), 240, 0.1, 0.15)));
GameLogEcho(strcat(":anticheat:div0_strafebot_old:", ftos(self.playerid), ":", anticheat_display(MEAN_EVALUATE(anticheat_div0_strafebot_old), 120, 0.3, 0.4)));
GameLogEcho(strcat(":anticheat:div0_strafebot_new:", ftos(self.playerid), ":", anticheat_display(MEAN_EVALUATE(anticheat_div0_strafebot_new), 120, 0.3, 0.4)));
GameLogEcho(strcat(":anticheat:div0_evade:", ftos(self.playerid), ":", anticheat_display(MEAN_EVALUATE(anticheat_div0_evade), 120, 0.1, 0.2)));
+ GameLogEcho(strcat(":anticheat:idle_snapaim:", ftos(self.playerid), ":", anticheat_display(MEAN_EVALUATE(anticheat_idle_snapaim_signal) - MEAN_EVALUATE(anticheat_idle_snapaim_noise), 120, 0.1, 0.2)));
+ GameLogEcho(strcat(":anticheat:idle_snapaim_signal:", ftos(self.playerid), ":", anticheat_display(MEAN_EVALUATE(anticheat_idle_snapaim_signal), 120, 0.1, 0.2)));
+ GameLogEcho(strcat(":anticheat:idle_snapaim_noise:", ftos(self.playerid), ":", anticheat_display(MEAN_EVALUATE(anticheat_idle_snapaim_noise), 120, 0.1, 0.2)));
+ GameLogEcho(strcat(":anticheat:idle_snapaim_m2:", ftos(self.playerid), ":", anticheat_display(MEAN_EVALUATE(anticheat_idle_snapaim_m2), 120, 0.1, 0.2)));
+ GameLogEcho(strcat(":anticheat:idle_snapaim_m3:", ftos(self.playerid), ":", anticheat_display(MEAN_EVALUATE(anticheat_idle_snapaim_m3), 120, 0.1, 0.2)));
+ GameLogEcho(strcat(":anticheat:idle_snapaim_m4:", ftos(self.playerid), ":", anticheat_display(MEAN_EVALUATE(anticheat_idle_snapaim_m4), 120, 0.1, 0.2)));
+ GameLogEcho(strcat(":anticheat:idle_snapaim_m7:", ftos(self.playerid), ":", anticheat_display(MEAN_EVALUATE(anticheat_idle_snapaim_m7), 120, 0.1, 0.2)));
+ GameLogEcho(strcat(":anticheat:idle_snapaim_m10:", ftos(self.playerid), ":", anticheat_display(MEAN_EVALUATE(anticheat_idle_snapaim_m10), 120, 0.1, 0.2)));
+}
+
+float anticheat_getvalue(string id)
+{
+ switch(id) {
+ case "_time": return servertime - self.anticheat_jointime;
+ case "speedhack": return MEAN_EVALUATE(anticheat_speedhack);
+ case "speedhack_m1": return MEAN_EVALUATE(anticheat_speedhack_m1);
+ case "speedhack_m2": return MEAN_EVALUATE(anticheat_speedhack_m2);
+ case "speedhack_m3": return MEAN_EVALUATE(anticheat_speedhack_m3);
+ case "speedhack_m4": return MEAN_EVALUATE(anticheat_speedhack_m4);
+ case "speedhack_m5": return MEAN_EVALUATE(anticheat_speedhack_m5);
+ case "div0_strafebot_old": return MEAN_EVALUATE(anticheat_div0_strafebot_old);
+ case "div0_strafebot_new": return MEAN_EVALUATE(anticheat_div0_strafebot_new);
+ case "div0_evade": return MEAN_EVALUATE(anticheat_div0_evade);
+ case "idle_snapaim": return MEAN_EVALUATE(anticheat_idle_snapaim_signal) - MEAN_EVALUATE(anticheat_idle_snapaim_noise);
+ case "idle_snapaim_signal": return MEAN_EVALUATE(anticheat_idle_snapaim_signal);
+ case "idle_snapaim_noise": return MEAN_EVALUATE(anticheat_idle_snapaim_noise);
+ case "idle_snapaim_m2": return MEAN_EVALUATE(anticheat_idle_snapaim_m2);
+ case "idle_snapaim_m3": return MEAN_EVALUATE(anticheat_idle_snapaim_m3);
+ case "idle_snapaim_m4": return MEAN_EVALUATE(anticheat_idle_snapaim_m4);
+ case "idle_snapaim_m7": return MEAN_EVALUATE(anticheat_idle_snapaim_m7);
+ case "idle_snapaim_m10": return MEAN_EVALUATE(anticheat_idle_snapaim_m10);
+ }
+ return -1;
+}
+
+void anticheat_startframe()
+{
+ anticheat_div0_evade_evasion_delta += frametime * (0.5 + random());
+}
+
+void anticheat_fixangle()
+{
+ self.anticheat_fixangle_endtime = servertime + ANTILAG_LATENCY(self) + 0.2;
}
-void anticheat_serverframe()
+void anticheat_endframe()
{
+ entity oldself = self;
+ FOR_EACH_CLIENT(self)
+ if (self.fixangle)
+ anticheat_fixangle();
+ self = oldself;
anticheat_div0_evade_evasion_delta += frametime * (0.5 + random());
}
void anticheat_spectatecopy(entity spectatee);
void anticheat_prethink();
-void anticheat_serverframe();
+float anticheat_getvalue(string name);
+
+void anticheat_startframe();
+void anticheat_endframe();
+
+void anticheat_fixangle();
vector dst_ahead, dst_down;
makevectors(self.v_angle_y * '0 1 0');
dst_ahead = self.origin + self.view_ofs + (self.velocity * 0.4) + (v_forward * 32 * 3);
- dst_down = dst_ahead + '0 0 -1500';
+ dst_down = dst_ahead - '0 0 1500';
// Look ahead
- traceline(self.origin + self.view_ofs , dst_ahead, TRUE, world);
+ traceline(self.origin + self.view_ofs, dst_ahead, TRUE, world);
// Check head-banging against walls
if(vlen(self.origin + self.view_ofs - trace_endpos) < 25 && !(self.aistatus & AI_STATUS_OUT_WATER))
// add a way to see what the items were BEFORE all of these checks for the mutator hook
olditems = self.items;
- if((self.items & IT_USING_JETPACK) && !self.deadflag)
+ if((self.items & IT_USING_JETPACK) && !self.deadflag && !gameover)
self.modelflags |= MF_ROCKET;
else
self.modelflags &= ~MF_ROCKET;
*/
void PlayerJump (void)
{
+ if(self.player_blocked)
+ return; // no jumping while blocked
+
float doublejump = FALSE;
player_multijump = doublejump;
maxspd_mod = 1;
if(self.ballcarried)
- if(g_nexball)
- maxspd_mod *= autocvar_g_nexball_basketball_carrier_highspeed;
- else if(g_keepaway)
+ if(g_keepaway)
maxspd_mod *= autocvar_g_keepaway_ballcarrier_highspeed;
maxspd_mod *= autocvar_g_movement_highspeed;
Portal_ClearAllLater(self);
- if(IS_REAL_CLIENT(self))
- {
- self.fixangle = TRUE;
- //msg_entity = self;
- //WriteByte (MSG_ONE, SVC_SETANGLE);
- //WriteAngle (MSG_ONE, self.v_angle_x);
- //WriteAngle (MSG_ONE, self.v_angle_y);
- //WriteAngle (MSG_ONE, 80);
- }
+ self.fixangle = TRUE;
if(defer_ClientKill_Now_TeamChange)
ClientKill_Now_TeamChange(); // can turn player into spectator
// 0 = reject
// -1 = fake accept
{
- string msgstr, colorstr, cmsgstr, namestr, fullmsgstr, sourcemsgstr, fullcmsgstr, sourcecmsgstr;
+ string msgstr, colorstr, cmsgstr, namestr, fullmsgstr, sourcemsgstr, fullcmsgstr, sourcecmsgstr, colorprefix;
float flood;
var .float flood_field;
entity head;
else
namestr = source.netname;
+ if(strdecolorize(namestr) == namestr)
+ colorprefix = "^3";
+ else
+ colorprefix = "^7";
+
if(msgin != "")
{
if(privatesay)
{
- msgstr = strcat("\{1}\{13}* ^3", namestr, "^3 tells you: ^7");
+ msgstr = strcat("\{1}\{13}* ", colorprefix, namestr, "^3 tells you: ^7");
privatemsgprefixlen = strlen(msgstr);
msgstr = strcat(msgstr, msgin);
- cmsgstr = strcat(colorstr, "^3", namestr, "^3 tells you:\n^7", msgin);
+ cmsgstr = strcat(colorstr, colorprefix, namestr, "^3 tells you:\n^7", msgin);
if(autocvar_g_chat_teamcolors)
privatemsgprefix = strcat("\{1}\{13}* ^3You tell ", playername(privatesay), ": ^7");
else
}
else if(teamsay)
{
- msgstr = strcat("\{1}\{13}", colorstr, "(^3", namestr, colorstr, ") ^7", msgin);
- cmsgstr = strcat(colorstr, "(^3", namestr, colorstr, ")\n^7", msgin);
+ msgstr = strcat("\{1}\{13}", colorstr, "(", colorprefix, namestr, colorstr, ") ^7", msgin);
+ cmsgstr = strcat(colorstr, "(", colorprefix, namestr, colorstr, ")\n^7", msgin);
}
else
{
- msgstr = strcat("\{1}", namestr, "^7: ", msgin);
+ msgstr = strcat("\{1}", colorprefix, namestr, "^7: ", msgin);
cmsgstr = "";
}
msgstr = strcat(strreplace("\n", " ", msgstr), "\n"); // newlines only are good for centerprint
}
MapInfo_ClearTemps();
- return sprintf("^7Maps available%s: %s\n", (newmaps ? " (New maps have asterisks marked in blue)" : ""), lsmaps);
+ return sprintf("^7Maps available (%d)%s: %s\n", tokenize_console(lsmaps), (newmaps ? " (New maps have asterisks marked in blue)" : ""), lsmaps);
}
string getmonsterlist()
{
case "debug":
{
+ float hitcount = 0;
print("TEST CASE. If this returns the runaway loop counter error, possibly everything is oaky.\n");
+ float worst_endpos_bug = 0;
for(;;)
{
org = world.mins;
end = stov(vtos(end));
tracebox(start, PL_MIN, PL_MAX, end, MOVE_NOMONSTERS, world);
- if(!trace_startsolid)
+ if(!trace_startsolid && trace_fraction < 1)
{
p = trace_endpos;
tracebox(p, PL_MIN, PL_MAX, p, MOVE_NOMONSTERS, world);
- if(trace_startsolid || trace_fraction == 1)
+ if(trace_startsolid)
{
rint(42); // do an engine breakpoint on VM_rint so you can get the trace that errnoeously returns startsolid
tracebox(start, PL_MIN, PL_MAX, end, MOVE_NOMONSTERS, world);
- if(trace_startsolid)
+ // how much do we need to back off?
+ safe = 1;
+ unsafe = 0;
+ for(;;)
{
- // how much do we need to back off?
- safe = 1;
- unsafe = 0;
- for(;;)
+ pos = p * (1 - (safe + unsafe) * 0.5) + start * ((safe + unsafe) * 0.5);
+ tracebox(pos, PL_MIN, PL_MAX, pos, MOVE_NOMONSTERS, world);
+ if(trace_startsolid)
{
- pos = p * (1 - (safe + unsafe) * 0.5) + start * ((safe + unsafe) * 0.5);
- tracebox(pos, PL_MIN, PL_MAX, pos, MOVE_NOMONSTERS, world);
- if(trace_startsolid)
- {
- if((safe + unsafe) * 0.5 == unsafe)
- break;
- unsafe = (safe + unsafe) * 0.5;
- }
- else
- {
- if((safe + unsafe) * 0.5 == safe)
- break;
- safe = (safe + unsafe) * 0.5;
- }
+ if((safe + unsafe) * 0.5 == unsafe)
+ break;
+ unsafe = (safe + unsafe) * 0.5;
}
-
- print("safe distance to back off: ", ftos(safe * vlen(p - start)), "qu\n");
- print("unsafe distance to back off: ", ftos(unsafe * vlen(p - start)), "qu\n");
-
- tracebox(p, PL_MIN + '0.1 0.1 0.1', PL_MAX - '0.1 0.1 0.1', p, MOVE_NOMONSTERS, world);
- if(trace_startsolid)
- print("trace_endpos much in solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p), "\n");
else
- print("trace_endpos just in solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p), "\n");
- break;
+ {
+ if((safe + unsafe) * 0.5 == safe)
+ break;
+ safe = (safe + unsafe) * 0.5;
+ }
}
+ print("safe distance to back off: ", ftos(safe * vlen(p - start)), "qu\n");
+ print("unsafe distance to back off: ", ftos(unsafe * vlen(p - start)), "qu\n");
+
+ tracebox(p, PL_MIN + '0.1 0.1 0.1', PL_MAX - '0.1 0.1 0.1', p, MOVE_NOMONSTERS, world);
+ if(trace_startsolid)
+ print("trace_endpos much in solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p), "\n");
+ else
+ print("trace_endpos just in solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p), "\n");
+ if (++hitcount >= 10)
+ break;
+ }
+ else
+ {
q0 = p;
dq = 0;
dqf = 1;
dqf *= 0.5;
q0 = q;
}
- if(dq > 0)
+ if(dq > worst_endpos_bug)
{
+ worst_endpos_bug = dq;
print("trace_endpos still before solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p), "\n");
print("could go ", ftos(dq), " units further to ", vtos(q), "\n");
- break;
+ if (++hitcount >= 10)
+ break;
}
}
}
e.fire_hitsound = TRUE;
if (!IS_INDEPENDENT_PLAYER(e))
+ if(!e.freezetag_frozen)
FOR_EACH_PLAYER(other) if(e != other)
{
if(IS_PLAYER(other))
// - for this timelimit_overtime needs to be >0 of course
// - also check the winning condition calculated in the previous frame and only add normal overtime
// again, if at the point at which timelimit would be extended again, still no winner was found
- if (!autocvar_g_campaign && (checkrules_overtimesadded >= 0) && (checkrules_overtimesadded < autocvar_timelimit_overtimes) && autocvar_timelimit_overtime && !(g_race && !g_race_qualifying))
+ if (!autocvar_g_campaign && (checkrules_overtimesadded >= 0) && (checkrules_overtimesadded < autocvar_timelimit_overtimes || autocvar_timelimit_overtimes < 0) && autocvar_timelimit_overtime && !(g_race && !g_race_qualifying))
{
return 1; // need to call InitiateOvertime later
}
void EndFrame()
{
+ anticheat_endframe();
+
float altime;
FOR_EACH_REALCLIENT(self)
{
if(gameover) { return; }
vector oldballorigin = self.origin;
- if(MoveToRandomMapLocation(self, DPCONTENTS_SOLID | DPCONTENTS_CORPSE | DPCONTENTS_PLAYERCLIP, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_BODY | DPCONTENTS_DONOTENTER, Q3SURFACEFLAG_SKY, 10, 1024, 256))
+ if(!MoveToRandomMapLocation(self, DPCONTENTS_SOLID | DPCONTENTS_CORPSE | DPCONTENTS_PLAYERCLIP, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_BODY | DPCONTENTS_DONOTENTER, Q3SURFACEFLAG_SKY, 10, 1024, 256))
{
- makevectors(self.angles);
- self.movetype = MOVETYPE_BOUNCE;
- self.velocity = '0 0 200';
- self.angles = '0 0 0';
- self.effects = autocvar_g_keepawayball_effects;
- self.think = ka_RespawnBall;
- self.nextthink = time + autocvar_g_keepawayball_respawntime;
+ entity spot = SelectSpawnPoint(TRUE);
+ setorigin(self, spot.origin);
+ self.angles = spot.angles;
+ }
- pointparticles(particleeffectnum("electro_combo"), oldballorigin, '0 0 0', 1);
- pointparticles(particleeffectnum("electro_combo"), self.origin, '0 0 0', 1);
+ makevectors(self.angles);
+ self.movetype = MOVETYPE_BOUNCE;
+ self.velocity = '0 0 200';
+ self.angles = '0 0 0';
+ self.effects = autocvar_g_keepawayball_effects;
+ self.think = ka_RespawnBall;
+ self.nextthink = time + autocvar_g_keepawayball_respawntime;
- WaypointSprite_Spawn("ka-ball", 0, 0, self, '0 0 64', world, self.team, self, waypointsprite_attachedforcarrier, FALSE, RADARICON_FLAGCARRIER, '0 1 1');
- WaypointSprite_Ping(self.waypointsprite_attachedforcarrier);
+ pointparticles(particleeffectnum("electro_combo"), oldballorigin, '0 0 0', 1);
+ pointparticles(particleeffectnum("electro_combo"), self.origin, '0 0 0', 1);
- sound(self, CH_TRIGGER, "keepaway/respawn.wav", VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
- }
- else
- {
- ka_RespawnBall(); // finding a location failed, retry
- }
+ WaypointSprite_Spawn("ka-ball", 0, 0, self, '0 0 64', world, self.team, self, waypointsprite_attachedforcarrier, FALSE, RADARICON_FLAGCARRIER, '0 1 1');
+ WaypointSprite_Ping(self.waypointsprite_attachedforcarrier);
+
+ sound(self, CH_TRIGGER, "keepaway/respawn.wav", VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
}
void ka_TimeScoring()
// messages and sounds
ka_EventLog("pickup", other);
Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_KEEPAWAY_PICKUP, other.netname);
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_KEEPAWAY_PICKUP, other.netname);
+ Send_Notification(NOTIF_ALL_EXCEPT, other, MSG_CENTER, CENTER_KEEPAWAY_PICKUP, other.netname);
+ Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_KEEPAWAY_PICKUP_SELF);
sound(self.owner, CH_TRIGGER, "keepaway/pickedup.wav", VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
// scoring
}
}
+// scoreboard setup
+void nb_ScoreRules(float teams)
+{
+ ScoreRules_basics(teams, 0, 0, TRUE);
+ ScoreInfo_SetLabel_TeamScore( ST_NEXBALL_GOALS, "goals", SFL_SORT_PRIO_PRIMARY);
+ ScoreInfo_SetLabel_PlayerScore( SP_NEXBALL_GOALS, "goals", SFL_SORT_PRIO_PRIMARY);
+ ScoreInfo_SetLabel_PlayerScore(SP_NEXBALL_FAULTS, "faults", SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER);
+ ScoreRules_basics_end();
+}
+
void nb_delayedinit(void)
{
if(find(world, classname, "nexball_team") == world)
nb_spawnteams();
- ScoreRules_nexball(nb_teams);
+ nb_ScoreRules(nb_teams);
}
void SpawnBall(void)
{
- if(!g_nexball)
- {
- remove(self);
- return;
- }
+ if(!g_nexball) { remove(self); return; }
// balls += 4; // using the remaining bits to count balls will leave more than the max edict count, so it's fine
SpawnBall();
}
+float nb_Goal_Customize()
+{
+ entity e, wp_owner;
+ e = WaypointSprite_getviewentity(other);
+ wp_owner = self.owner;
+ if(SAME_TEAM(e, wp_owner)) { return FALSE; }
+
+ return TRUE;
+}
+
void SpawnGoal(void)
{
- if(!g_nexball)
+ if(!g_nexball) { remove(self); return; }
+
+ EXACTTRIGGER_INIT;
+
+ if(self.team != GOAL_OUT && Team_TeamToNumber(self.team) != -1)
{
- remove(self);
- return;
+ WaypointSprite_SpawnFixed("goal", (self.absmin + self.absmax) * 0.5, self, sprite, RADARICON_NONE, ((self.team) ? Team_ColorRGB(self.team) : '1 0.5 0'));
+ self.sprite.customizeentityforclient = nb_Goal_Customize;
}
- EXACTTRIGGER_INIT;
+
self.classname = "nexball_goal";
if(self.noise == "")
self.noise = "ctf/respawn.wav";
PROJECTILE_TOUCH;
if(attacker.team != other.team || autocvar_g_nexball_basketball_teamsteal)
- if((ball = other.ballcarried) && (IS_PLAYER(attacker)))
+ if((ball = other.ballcarried) && !other.deadflag && (IS_PLAYER(attacker)))
{
other.velocity = other.velocity + normalize(self.velocity) * other.damageforcescale * autocvar_g_balance_nexball_secondary_force;
other.flags &= ~FL_ONGROUND;
LogNB("stole", attacker);
sound(other, CH_TRIGGER, ball.noise2, VOL_BASE, ATTEN_NORM);
- if(attacker.team == other.team && time > attacker.teamkill_complain)
+ if(SAME_TEAM(attacker, other) && time > attacker.teamkill_complain)
{
attacker.teamkill_complain = time + 5;
attacker.teamkill_soundtime = time + 0.4;
missile.movetype = MOVETYPE_FLY;
PROJECTILE_MAKETRIGGER(missile);
- setmodel(missile, "models/elaser.mdl"); // precision set below
+ //setmodel(missile, "models/elaser.mdl"); // precision set below
setsize(missile, '0 0 0', '0 0 0');
setorigin(missile, w_shotorg);
missile.effects = EF_BRIGHTFIELD | EF_LOWPRECISION;
missile.flags = FL_PROJECTILE;
+
+ CSQCProjectile(missile, TRUE, PROJECTILE_ELECTRO, TRUE);
}
float ball_customize()
return 0;
}
-MUTATOR_HOOKFUNCTION(nexball_BuildMutatorsString)
-{
- ret_string = strcat(ret_string, ":NB");
- return 0;
-}
-
-MUTATOR_HOOKFUNCTION(nexball_BuildMutatorsPrettyString)
-{
- ret_string = strcat(ret_string, ", NexBall");
- return 0;
-}
-
MUTATOR_HOOKFUNCTION(nexball_PlayerPreThink)
{
makevectors(self.v_angle);
return FALSE;
}
+MUTATOR_HOOKFUNCTION(nexball_PlayerPhysics)
+{
+ if(self.ballcarried)
+ {
+ self.stat_sv_airspeedlimit_nonqw *= autocvar_g_nexball_basketball_carrier_highspeed;
+ self.stat_sv_maxspeed *= autocvar_g_nexball_basketball_carrier_highspeed;
+ }
+ return FALSE;
+}
+
MUTATOR_HOOKFUNCTION(nexball_SetStartItems)
{
start_items |= IT_UNLIMITED_SUPERWEAPONS; // FIXME BAD BAD BAD BAD HACK, NEXBALL SHOULDN'T ABUSE PORTO'S WEAPON SLOT
return FALSE;
}
+MUTATOR_HOOKFUNCTION(nexball_ForbidThrowing)
+{
+ if(self.weapon == WEP_GRENADE_LAUNCHER)
+ return TRUE;
+
+ return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(nexball_FilterItem)
+{
+ if(self.classname == "droppedweapon")
+ if(self.weapon == WEP_GRENADE_LAUNCHER)
+ return TRUE;
+
+ return FALSE;
+}
+
MUTATOR_DEFINITION(gamemode_nexball)
{
MUTATOR_HOOK(PlayerDies, nexball_BallDrop, CBC_ORDER_ANY);
MUTATOR_HOOK(MakePlayerObserver, nexball_BallDrop, CBC_ORDER_ANY);
MUTATOR_HOOK(ClientDisconnect, nexball_BallDrop, CBC_ORDER_ANY);
- MUTATOR_HOOK(BuildMutatorsPrettyString, nexball_BuildMutatorsPrettyString, CBC_ORDER_ANY);
- MUTATOR_HOOK(BuildMutatorsString, nexball_BuildMutatorsString, CBC_ORDER_ANY);
MUTATOR_HOOK(PlayerSpawn, nexball_PlayerSpawn, CBC_ORDER_ANY);
MUTATOR_HOOK(PlayerPreThink, nexball_PlayerPreThink, CBC_ORDER_ANY);
+ MUTATOR_HOOK(PlayerPhysics, nexball_PlayerPhysics, CBC_ORDER_ANY);
MUTATOR_HOOK(SetStartItems, nexball_SetStartItems, CBC_ORDER_ANY);
+ MUTATOR_HOOK(ForbidThrowCurrentWeapon, nexball_ForbidThrowing, CBC_ORDER_ANY);
+ MUTATOR_HOOK(FilterItem, nexball_FilterItem, CBC_ORDER_ANY);
MUTATOR_ONADD
{
g_nexball_meter_period = rint(g_nexball_meter_period * 32) / 32; //Round to 1/32ths to send as a byte multiplied by 32
addstat(STAT_NB_METERSTART, AS_FLOAT, metertime);
+ w_porto(WR_PRECACHE); // abuse
+
// General settings
/*
CVTOV(g_nexball_football_boost_forward); //100
MUTATOR_HOOKFUNCTION(msnt_PlayerSpawn)
{
+ // Note: when entering this, fixangle is already set.
if(autocvar_g_spawn_near_teammate_ignore_spawnpoint)
{
if(autocvar_g_spawn_near_teammate_ignore_spawnpoint_delay_death)
setorigin(self, trace_endpos);
self.angles = team_mate.angles;
self.angles_z = 0; // never spawn tilted even if the spot says to
- self.fixangle = TRUE; // turn this way immediately
team_mate.msnt_timer = time + autocvar_g_spawn_near_teammate_ignore_spawnpoint_delay;
return 0;
}
setorigin(self, best_spot);
self.angles = best_mate.angles;
self.angles_z = 0; // never spawn tilted even if the spot says to
- self.fixangle = TRUE; // turn this way immediately
best_mate.msnt_timer = time + autocvar_g_spawn_near_teammate_ignore_spawnpoint_delay;
}
}
self.angles = vectoangles(spawn_spot.msnt_lookat.origin - self.origin);
self.angles_x = -self.angles_x;
self.angles_z = 0; // never spawn tilted even if the spot says to
- self.fixangle = TRUE; // turn this way immediately
/*
sprint(self, "You should be looking at ", spawn_spot.msnt_lookat.netname, "^7.\n");
sprint(self, "distance: ", vtos(spawn_spot.msnt_lookat.origin - self.origin), "\n");
.float playerstats_addedglobalinfo;
.string playerstats_id;
+#define ALL_ANTICHEATS \
+ ANTICHEAT("_time"); \
+ ANTICHEAT("speedhack"); \
+ ANTICHEAT("speedhack_m1"); \
+ ANTICHEAT("speedhack_m2"); \
+ ANTICHEAT("speedhack_m3"); \
+ ANTICHEAT("speedhack_m4"); \
+ ANTICHEAT("speedhack_m5"); \
+ ANTICHEAT("div0_strafebot_old"); \
+ ANTICHEAT("div0_strafebot_new"); \
+ ANTICHEAT("div0_evade"); \
+ ANTICHEAT("idle_snapaim"); \
+ ANTICHEAT("idle_snapaim_signal"); \
+ ANTICHEAT("idle_snapaim_noise"); \
+ ANTICHEAT("idle_snapaim_m2"); \
+ ANTICHEAT("idle_snapaim_m3"); \
+ ANTICHEAT("idle_snapaim_m4"); \
+ ANTICHEAT("idle_snapaim_m7"); \
+ ANTICHEAT("idle_snapaim_m10");
+
void PlayerStats_Init() // initiated before InitGameplayMode so that scores are added properly
{
string uri;
PlayerStats_AddEvent(strcat("acc-", w.netname, "-frags"));
}
+#define ANTICHEAT(name) \
+ PlayerStats_AddEvent("anticheat-" name)
+ ALL_ANTICHEATS
+#undef ANTICHEAT
+
PlayerStats_AddEvent(PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_3);
PlayerStats_AddEvent(PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_5);
PlayerStats_AddEvent(PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_10);
//backtrace(strcat("adding player stat accuracy for ", p.netname, ".\n"));
}
+void PlayerStats_Anticheat(entity p)
+{
+ entity oldself = self;
+ self = p;
+
+#define ANTICHEAT(name) \
+ PlayerStats_Event(p, "anticheat-" name, anticheat_getvalue(name))
+ ALL_ANTICHEATS
+#undef ANTICHEAT
+ self = oldself;
+}
+
void PlayerStats_AddGlobalInfo(entity p)
{
if(playerstats_db < 0)
PlayerStats_Accuracy(p);
+ PlayerStats_Anticheat(p);
+
if(IS_REAL_CLIENT(p))
{
if(p.latency_cnt)
}
}
}
+
+#undef ALL_ANTICHEATS
FOR_EACH_PLAYER(self)
self.porto_forbidden = max(0, self.porto_forbidden - 1);
+ anticheat_startframe();
+
MUTATOR_CALLHOOK(SV_StartFrame);
}
void WarpZone_PostTeleportPlayer_Callback(entity pl)
{
UpdateCSQCProjectileAfterTeleport(pl);
+ {
+ entity oldself = self;
+ self = pl;
+ anticheat_fixangle();
+ self = oldself;
+ }
// "disown" projectiles after teleport
if(pl.owner)
if(pl.owner == pl.realowner)
{
if(!activator)
return;
+ if(!IS_REAL_CLIENT(activator))
+ return;
msg_entity = activator;
target_music_sendto(MSG_ONE, 1);
+ entity head;
+ FOR_EACH_SPEC(head) if(head.enemy == activator) { msg_entity = head; target_music_sendto(MSG_ONE, 1); }
}
void spawnfunc_target_music()
{
// a player's mines shall explode if he disconnects or dies
// TODO: Do this on team change too -- Samual: But isn't a player killed when they switch teams?
- if(!IS_PLAYER(self.realowner) || self.realowner.deadflag != DEAD_NO)
+ if(!IS_PLAYER(self.realowner) || self.realowner.deadflag != DEAD_NO || self.realowner.freezetag_frozen)
{
other = world;
self.projectiledeathtype |= HITTYPE_BOUNCE;
head = findradius(self.origin, autocvar_g_balance_minelayer_proximityradius);
while(head)
{
- if(IS_PLAYER(head) && head.deadflag == DEAD_NO)
+ if(IS_PLAYER(head) && head.deadflag == DEAD_NO && !head.freezetag_frozen)
if(head != self.realowner && DIFF_TEAM(head, self.realowner)) // don't trigger for team mates
if(!self.mine_time)
{