X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fweapons%2Faccuracy.qc;h=7cc06da3e6dc05b32595b85556ff43d4ecb11225;hp=211ef8cec090682aeaf040286f54018f8ff27376;hb=7908f6be3a5bcdb29c7fc4ca663b919ed023b1f3;hpb=317ec3eb27ada1c4668876e9499136125acb7984 diff --git a/qcsrc/server/weapons/accuracy.qc b/qcsrc/server/weapons/accuracy.qc index 211ef8cec..7cc06da3e 100644 --- a/qcsrc/server/weapons/accuracy.qc +++ b/qcsrc/server/weapons/accuracy.qc @@ -1,10 +1,11 @@ #include "accuracy.qh" -#include "../mutators/all.qh" -#include "../../common/constants.qh" -#include "../../common/teams.qh" -#include "../../common/util.qh" -#include "../../common/weapons/all.qh" +#include "../mutators/_mod.qh" +#include +#include +#include +#include +#include int accuracy_byte(float n, float d) { @@ -39,8 +40,7 @@ bool accuracy_send(entity this, entity to, int sf) // init/free void accuracy_init(entity e) { - entity a = e.accuracy = new(accuracy); - make_pure(a); + entity a = e.accuracy = new_pure(accuracy); a.owner = e; a.drawonlytoclient = e; Net_LinkEntity(a, false, 0, accuracy_send); @@ -48,7 +48,7 @@ void accuracy_init(entity e) void accuracy_free(entity e) { - remove(e.accuracy); + delete(e.accuracy); } // force a resend of a player's accuracy stats @@ -58,7 +58,7 @@ void accuracy_resend(entity e) } // update accuracy stats -.float hit_time; +//.float hit_time; .float fired_time; void accuracy_add(entity this, int w, int fired, int hit) @@ -85,9 +85,7 @@ void accuracy_add(entity this, int w, int fired, int hit) if (b == accuracy_byte(a.accuracy_hit[w], a.accuracy_fired[w])) return; // no change int sf = 1 << (w % 24); a.SendFlags |= sf; - entity e; FOR_EACH_CLIENT(e) if (IS_SPEC(e)) if (e.enemy == this) { - e.accuracy.SendFlags |= sf; - } + FOREACH_CLIENT(IS_SPEC(it) && it.enemy == this, LAMBDA(it.accuracy.SendFlags |= sf)); } bool accuracy_isgooddamage(entity attacker, entity targ) @@ -95,8 +93,8 @@ bool accuracy_isgooddamage(entity attacker, entity targ) int mutator_check = MUTATOR_CALLHOOK(AccuracyTargetValid, attacker, targ); if (warmup_stage) return false; - if (targ.deadflag != DEAD_NO) return false; - if (targ.frozen) return false; + if (IS_DEAD(targ)) return false; + if (STAT(FROZEN, targ)) return false; if (SAME_TEAM(attacker, targ)) return false; if (mutator_check == MUT_ACCADD_INVALID) return true;