17 if (n > d)
return 255;
18 return 1 +
rint(n * 100.0 / d);
23 WriteHeader(MSG_ENTITY, ENT_CLIENT_ACCURACY);
33 WriteInt24_t(MSG_ENTITY, sf);
34 if (sf == 0)
return true;
39 f = (f == 0x800000) ? 1 : f * 2;
49 a.drawonlytoclient = e;
55 delete(
CS(e).accuracy);
65 a.accuracy_frags[i] = 0;
66 a.accuracy_hit[i] = 0;
67 a.accuracy_fired[i] = 0;
68 a.accuracy_cnt_hit[i] = 0;
69 a.accuracy_cnt_fired[i] = 0;
76 CS(e).accuracy.SendFlags = 0xFFFFFF;
88 if (!hit && !fired)
return;
89 if (w == WEP_Null)
return;
92 int b =
accuracy_byte(a.accuracy_hit[wepid], a.accuracy_fired[wepid]);
93 if (hit) a.accuracy_hit [wepid] += hit;
94 if (fired) a.accuracy_fired[wepid] += fired;
96 if (hit && STAT(HIT_TIME, a) !=
time) {
97 a.accuracy_cnt_hit[wepid] += 1;
98 STAT(HIT_TIME, a) =
time;
101 if (fired && a.fired_time !=
time) {
102 a.accuracy_cnt_fired[wepid] += 1;
106 if (b ==
accuracy_byte(a.accuracy_hit[wepid], a.accuracy_fired[wepid]))
return;
107 int sf = 1 << (wepid % 24);
120 if (
IS_DEAD(targ) &&
time > targ.death_time)
return false;
121 if (STAT(FROZEN, targ) &&
time > targ.freeze_time)
return false;
122 if (
SAME_TEAM(attacker, targ))
return false;
137 REPLICATE(cvar_cl_accuracy_data_share,
bool,
"cl_accuracy_data_share");
138 REPLICATE(cvar_cl_accuracy_data_receive,
bool,
"cl_accuracy_data_receive");
#define IS_INDEPENDENT_PLAYER(e)
ClientState CS(Client this)
#define FOREACH_CLIENT(cond, body)
int accuracy_byte(float n, float d)
bool accuracy_send(entity this, entity to, int sf)
void accuracy_free(entity e)
void accuracy_reset(entity e)
void accuracy_init(entity e)
float autocvar_sv_accuracy_data_share
Weapon Accuracy stats.
void accuracy_add(entity this, Weapon w, float fired, float hit)
bool accuracy_isgooddamage(entity attacker, entity targ)
#define MUTATOR_CALLHOOK(id,...)
#define new_pure(class)
purely logical entities (.origin doesn't work)
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
bool accuracy_canbegooddamage(entity attacker)
void accuracy_resend(entity e)
REPLICATE(cvar_cl_accuracy_data_share, bool, "cl_accuracy_data_share")