Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
hitplot.qh File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void W_HitPlotAnalysis (entity player, entity wep, vector screenforward, vector screenright, vector screenup)
void W_HitPlotClose (entity player)
void W_HitPlotOpen (entity player)

Variables

bool autocvar_g_hitplots
string autocvar_g_hitplots_individuals
float hitplotfh

Function Documentation

◆ W_HitPlotAnalysis()

void W_HitPlotAnalysis ( entity player,
entity wep,
vector screenforward,
vector screenright,
vector screenup )

Definition at line 58 of file hitplot.qc.

59{
60 if(CS(player).hitplotfh >= 0)
61 {
62 float lag = ANTILAG_LATENCY(player);
63 if(lag < 0.001)
64 lag = 0;
65 if(!IS_REAL_CLIENT(player))
66 lag = 0; // only antilag for clients
67
68 vector org = player.origin + player.view_ofs;
69 traceline_antilag_force(player, org, org + screenforward * max_shot_distance, MOVE_NORMAL, player, lag);
71 {
73 antilag_takeback(trace_ent, store, time - lag);
74 vector hitplot = W_HitPlotNormalizedUntransform(org, trace_ent, screenforward, screenright, screenup, trace_endpos);
76 fputs(CS(player).hitplotfh, strcat(ftos(hitplot.x), " ", ftos(hitplot.y), " ", ftos(hitplot.z), " ", ftos(wep.m_id), "\n"));
77 //print(strcat(ftos(hitplot_x), " ", ftos(hitplot_y), " ", ftos(hitplot_z), "\n"));
78 }
79 }
80}
void antilag_restore(entity e, entity store)
Definition antilag.qc:101
void traceline_antilag_force(entity source, vector v1, vector v2, float nomonst, entity forent, float lag)
Definition antilag.qc:199
void antilag_takeback(entity e, entity store, float t)
Definition antilag.qc:86
#define ANTILAG_LATENCY(e)
Definition antilag.qh:19
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define IS_CLIENT(s)
Definition player.qh:242
entity trace_ent
const float MOVE_NORMAL
float time
vector trace_endpos
vector W_HitPlotNormalizedUntransform(vector org, entity targ, vector screenforward, vector screenright, vector screenup, vector v)
Definition hitplot.qc:21
float hitplotfh
Definition hitplot.qh:6
void fputs(float fhandle, string s)
string ftos(float f)
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
vector
Definition self.qh:92
vector org
Definition self.qh:92
ClientState CS(Client this)
Definition state.qh:47
#define IS_REAL_CLIENT(v)
Definition utils.qh:17
#define IS_MONSTER(v)
Definition utils.qh:21
int max_shot_distance
Definition weapon.qh:203

References ANTILAG_LATENCY, antilag_restore(), antilag_takeback(), CS(), entity(), fputs(), ftos(), hitplotfh, IS_CLIENT, IS_MONSTER, IS_REAL_CLIENT, max_shot_distance, MOVE_NORMAL, org, strcat(), time, trace_endpos, trace_ent, traceline_antilag_force(), vector, and W_HitPlotNormalizedUntransform().

Referenced by W_SetupShot_Dir_ProjectileSize_Range().

◆ W_HitPlotClose()

void W_HitPlotClose ( entity player)

Definition at line 92 of file hitplot.qc.

93{
94 if(CS(player).hitplotfh >= 0)
95 {
96 fclose(CS(player).hitplotfh);
97 CS(player).hitplotfh = -1;
98 }
99}
void fclose(float fhandle)

◆ W_HitPlotOpen()

void W_HitPlotOpen ( entity player)

Definition at line 82 of file hitplot.qc.

83{
85 {
86 CS(player).hitplotfh = fopen(strcat("hits-", matchid, "-", player.netaddress, "-", ftos(player.playerid), ".plot"), FILE_WRITE);
87 fputs(CS(player).hitplotfh, strcat("#name ", playername(player.netname, player.team, false), "\n"));
88 }
89 else { CS(player).hitplotfh = -1; }
90}
string playername(string thename, int teamid, bool team_colorize)
Definition util.qc:2082
const float FILE_WRITE
bool autocvar_g_hitplots
Definition hitplot.qh:3
string autocvar_g_hitplots_individuals
Definition hitplot.qh:4
float fopen(string filename, float mode)
#define strhasword(s, w)
Definition string.qh:370
string matchid
Definition world.qh:63

Variable Documentation

◆ autocvar_g_hitplots

bool autocvar_g_hitplots

Definition at line 3 of file hitplot.qh.

Referenced by W_HitPlotOpen().

◆ autocvar_g_hitplots_individuals

string autocvar_g_hitplots_individuals

Definition at line 4 of file hitplot.qh.

Referenced by W_HitPlotOpen().

◆ hitplotfh

float hitplotfh

Definition at line 6 of file hitplot.qh.

Referenced by W_HitPlotAnalysis(), W_HitPlotClose(), and W_HitPlotOpen().